VPS侦探论坛

 找回密码
 注册
查看: 4668|回复: 1

open_basedir相关问题

[复制链接]
发表于 2017-4-6 11:01:04 | 显示全部楼层 |阅读模式

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 76

Warning: 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 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2017-4-6 15:06:31 | 显示全部楼层


和php.ini没关系,你下面不是发了修改方法了,不行就直接删掉.user.ini

1.4的话还有其他设置,参考:https://lnmp.org/faq/lnmp-vhost-add-howto.html#user.ini
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-11-17 10:38 , Processed in 0.025538 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表