go to bug id or search bugs for
file_exists() etc. does not allow checking the existence of files outside the directories specified in open_basedir.
This can be circumvented using glob(). glob() does check open_basedir, but its return type still reveals whether files exist outside open_basedir. The existence of a file can be checked using !is_array(glob($filename)).
Add a Patch
Add a Pull Request
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.
The fix for this bug introduced a regression.
open_basedir = /home/pierre/cvs/php52
glob fails to access this path:
Warning: glob(): Unable to access /home/pierre/cvs/php52/ext/*/tests in Command line code on line 1
This is unavoidable since you don't want things like:
to be let through.
Please, you can't break BC at this point. My example works before and must work now.
has nothing to do with my example except that you add relative paths later. It is simply another case that should fail because of open_basedir.
My example introduces a huge BC break in symfony, to list only one widely used "app". Back to open, if you don't want to fix it yourself, please let me know, I will have to do it myself.
Related To: Bug #69693