- chimney2011-10-10金牌会员466
转移服务器,有一个程序提示了如下
Warning: require_once() [function.require-once]: open_basedir restriction in effect. File(../123.com/global.php) is not within the allowed path(s): (/home/wwwroot/abc.com:/tmp/:/var/tmp/:/proc/) in /home/wwwroot/abc.com/index.php on line 2
网上搜了下,说是这个原因
“当时为了限制不同的虚拟空间只能在自己的空间中进行操作的时候设置了APACHE的权限,php_admin_value open_basedir限定执行目录,而在NGINX上没有APACHE这么简单的配置,所以采用了在PHP中进行限制,首先至少防止了PHP用户通过代码控制到ROOT权限。于是查看了php.ini的配置,果然是问题所在,修改的方法很简单,在php.ini配置文件的open_basedir中增加对应批处理程序的目录即可。
”
然后我找到php.ini,把这段
; open_basedir, if set, limits all file operations to the defined directory
; and below. This directive makes most sense if used in a per-directory
; or per-virtualhost web server configuration file. This directive is
; NOT affected by whether Safe Mode is turned On or Off.
; open_basedir =
最后一句修改为
"open_basedir = /home/wwwroot/abc.com/"
重启了lnpma后,没用,请各位高手赐教……[ 本帖最后由 chimney 于 2011-10-10 04:57 编辑 ]