hi,欢迎访问本站!
当前位置: 首页学习笔记正文

THINKPHP搭建报错Warning: require(): open_basedir restriction in effect.File() is not within the allowed

用户投稿 学习笔记 21阅读

注意:当前只适用于LNMP环境

会提示

Warning: require(): open_basedir restriction in effect. File(/www/wwwroot/wxsmallhuiyi.solarbe.com/thinkphp/base.php) is not within the allowed path(s): (/www/wwwroot/wxsmallhuiyi.solarbe.com/public/:/tmp/:/proc/) in /www/wwwroot/wxsmallhuiyi.solarbe.com/public/install.php on line 17

Warning: require(/home/wwwroot/wxsmallhuiyi.solarbe.com/thinkphp/base.php): failed to open stream: Operation not permitted in /home/wwwroot/wxsmallhuiyi.solarbe.com/public/install.php on line 17

Fatal error: require(): Failed opening required '/www/wwwroot/wxsmallhuiyi.solarbe.com/public/../thinkphp/base.php' (include_path='.:/usr/local/php/lib/php') in /www/wwwroot/wxsmallhuiyi.solarbe.com/public/install.php on line 17

类似的错误

直接放大   其他的解决方案都是徒劳

www/sever/nginx/conf下修改fastcgi.conf(与nginx.conf文件同级目录下)  增加代码 

如有相关代码则将注释去掉   没有则增加对应代码

# 注释 # fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/"; # 修改为 fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/../:/tmp/:/proc/";

保存后重启nginx    搞定

标签:
声明:无特别说明,转载请标明本文来源!
发布评论
正文 取消