openbase_dir and subdirectories

不羁的心 提交于 2019-12-06 05:47:58
VPDD

From http://php.net/manual/en/ini.core.php#ini.open-basedir

The restriction specified with open_basedir is a directory name since PHP 5.2.16 and 5.3.4. Previous versions used it as a prefix. This means that "open_basedir = /dir/incl" also allowed access to "/dir/include" and "/dir/incls" if they exist. When you want to restrict access to only the specified directory, end with a slash. For example: open_basedir = /dir/incl/

/dir/incl/ = only the directory no subdirectories

dir/incl = all subdirectories

If Apache doesn't find some directory within specified path -- upgrading of some php module may fix the problem. I have such problem when used PHP 5.3.15 and eAccelerator which has been installed when I used PHP 5.3.3.

PHP with eAccelerator was unable to include all subdirectories within specified open_basedir, until I upgraded eAccelerator to appropriate version of PHP.

open_basedir means all subdirectories are available, once the basedir is on your include_path. You will of course need to make sure any paths to included files are correct, e.g. If you want something in /home/b/file you'll need to

include('b/file/myfile.php');
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!