-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grav crashes on IIS (Windows) with open_basedir in effect #2053
Comments
Hmm.. it's my understanding that the SPL iterators are far superior to the older glob() functions. In regards to performance especially. If you could create a PR with some specific detection and fallback to use the glob function for this IIS scenario, I would be interested in merging that. |
To me this almost looks like misconfiguration of PHP. The weird thing is that...
... by looking into those three paths, the first path is inside of the allowed paths. But why is the same path two times in the configuration? |
Maybe just replace |
I ended up rewriting the logic on fetching markdown files and folders in @rhukster If you have some multilanguage site available, please test if the right pages get picked up. On my tests, the logic seems to work just fine, but it doesn't hurt to have some extra testing. I also removed extra filtering for .md files, so as long as the main page file is in the extension fallback list, it will get picked up. |
Multilang test site seems to work fine. |
On a recent project I came across the following issue with a provider using IIS on Windows and an active
open_basedir
setting related to the usage ofGlobIterator
.I think this is caused by this PHP issues which never got resolved.
We have tested the issue with PHP 5.6.x, 7.1.x and 7.2.x all with the same result.
You can easily reproduce the issue if you can get hands on an IIS with the
open_basedir
set. I have attached two files to recreate the issue which you should place inside the path of theopen_basdir
setting:globiterator.php
globl
The GlobIterator is used in Common/Page/Pages.php:1011 and in the Grav Problems Plugin with the latter actually being the first Exception to be thrown (which can be skipped with disabling the problems plugin).
I have used
glob()
to patch the code for my project for now, but as hosting on IIS in conjunction withopen_basedir
setting mare be a rare case I just wanted to get some feedback before providing a PR.globiterator.zip
The text was updated successfully, but these errors were encountered: