A-A+

lnmp部署laravel项目报错:open_basedir

2020年08月10日 Laravel 暂无评论 阅读 3,247 views 次

错误信息:

[10-Aug-2020 10:25:41 PRC] PHP Warning: require(): open_basedir restriction in effect. File(/home/wwwroot/ting/vendor/autoload.php) is not within the allowed path(s): (/home/wwwroot/ting/public/:/tmp/:/proc/:/home/wwwroot/huanyue/:/home/wwwroot/office/huanyue-office/:/home/wwwroot/office/ting/) in /home/wwwroot/ting/public/index.php on line 24

[10-Aug-2020 10:25:41 PRC] PHP Warning: require(/home/wwwroot/ting/vendor/autoload.php): failed to open stream: Operation not permitted in /home/wwwroot/ting/public/index.php on line 24

[10-Aug-2020 10:25:41 PRC] PHP Fatal error: require(): Failed opening required '/home/wwwroot/ting/public/../vendor/autoload.php' (include_path='.:/usr/local/php/lib/php') in /home/wwwroot/ting/public/index.php on line 24

 

解决办法:

修改文件:/usr/local/nginx/conf/fastcgi.conf

找到:fastcgi_param PHP_ADMIN_VALUE,在末尾添加网站根目录,例如:

fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/:/home/wwwroot/huanyue/:/home/wwwroot/office/huanyue-office/:/home/wwwroot/ting/";

这里添加了三个。

 

另外,可能存在的问题:

1、删除网站目录:.user.ini

chattr -i /home/wwwroot/yoursite/.user.ini

 

2、composer install

标签:

给我留言