open_basedir相关问题
Warning: require_once(): open_basedir restriction in effect. File(/home/wwwroot/yunjiebao-chuxing/chuxing.yunjiebao.cc/../common.lib.dunhetech.com/plugin/phprpc/phprpc_client.php) is not within the allowed path(s): (/home/wwwroot/yunjiebao-chuxing/chuxing.yunjiebao.cc:/tmp/:/proc/) in /home/wwwroot/yunjiebao-chuxing/chuxing.yunjiebao.cc/config/JetLite.config.php on line 76Warning: require_once(/home/wwwroot/yunjiebao-chuxing/chuxing.yunjiebao.cc/../common.lib.dunhetech.com/plugin/phprpc/phprpc_client.php): failed to open stream: Operation not permitted in /home/wwwroot/yunjiebao-chuxing/chuxing.yunjiebao.cc/config/JetLite.config.php on line 76
Fatal error: require_once(): Failed opening required '/home/wwwroot/yunjiebao-chuxing/chuxing.yunjiebao.cc/../common.lib.dunhetech.com/plugin/phprpc/phprpc_client.php' (include_path='.:/usr/local/php/lib/php') in /home/wwwroot/yunjiebao-chuxing/chuxing.yunjiebao.cc/config/JetLite.config.php on line 76
Warning: is_dir(): open_basedir restriction in effect. File(/home/wwwroot/yunjiebao-chuxing/chuxing.yunjiebao.cc//../logs/chuxing.yunjiebao.cc) is not within the allowed path(s): (/home/wwwroot/yunjiebao-chuxing/chuxing.yunjiebao.cc:/tmp/:/proc/) in /home/wwwroot/yunjiebao-chuxing/chuxing.yunjiebao.cc/index.php on line 62
Warning: mkdir(): open_basedir restriction in effect. File(/home/wwwroot/yunjiebao-chuxing/logs/chuxing.yunjiebao.cc) is not within the allowed path(s): (/home/wwwroot/yunjiebao-chuxing/chuxing.yunjiebao.cc:/tmp/:/proc/) in /home/wwwroot/yunjiebao-chuxing/chuxing.yunjiebao.cc/index.php on line 63
Warning: fopen(): open_basedir restriction in effect. File(/home/wwwroot/yunjiebao-chuxing/chuxing.yunjiebao.cc//../logs/chuxing.yunjiebao.cc/error.log) is not within the allowed path(s): (/home/wwwroot/yunjiebao-chuxing/chuxing.yunjiebao.cc:/tmp/:/proc/) in /home/wwwroot/yunjiebao-chuxing/chuxing.yunjiebao.cc/index.php on line 66
Warning: fopen(/home/wwwroot/yunjiebao-chuxing/chuxing.yunjiebao.cc//../logs/chuxing.yunjiebao.cc/error.log): failed to open stream: Operation not permitted in /home/wwwroot/yunjiebao-chuxing/chuxing.yunjiebao.cc/index.php on line 66
已经注释掉了php.ini里面的open_basedir,还是报错,找不到原因,请军哥指导一下。按照下面的方法操作.user.ini文件,将其open_basedir加“;”注释掉也没有效果。我的系统信息:Linux shuipingcent7 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
LNMP 1.2及更高版本防跨目录功能使用.user.ini,该文件在网站根目录下,可以修改open_basedir的值来设置限制目录的访问。
.user.ini文件无法直接修改,可以使用winscp文件管理、vim编辑器或nano编辑器进行修改。
如要修或删除需要先执行:chattr -i /网站目录/.user.ini
删除的话rm -f /网站目录/.user.ini 就可以。
修改完成后再执行:chattr +i /网站目录/.user.ini
.user.ini不需要重启一般5分钟左右生效,也可以重启一下php-fpm立即生效。
如果要更改网站目录必须要按上述方法修改防跨目录的设置,否则肯定报错!!
[ 本帖最后由 zhezhebie 于 2017-4-6 11:22 编辑 ] 和php.ini没关系,你下面不是发了修改方法了,不行就直接删掉.user.ini
1.4的话还有其他设置,参考:https://lnmp.org/faq/lnmp-vhost-add-howto.html#user.ini
页:
[1]