php laravel 宝塔 访问报错 Warning: require(): open_basedir restriction in effect.

错误信息

Warning: require(): open_basedir restriction in effect. File(/www/wwwroot/nxcrm/vendor/autoload.php) is not within the allowed path(s): (/www/wwwroot/nxcrm/public/:/tmp/) in /www/wwwroot/nxcrm/public/index.php on line 24

Warning: require(/www/wwwroot/nxcrm/vendor/autoload.php): Failed to open stream: Operation not permitted in /www/wwwroot/nxcrm/public/index.php on line 24

Fatal error: Uncaught Error: Failed opening required '/www/wwwroot/nxcrm/public/../vendor/autoload.php' (include_path='.:') in /www/wwwroot/nxcrm/public/index.php:24 Stack trace: #0 {main} thrown in /www/wwwroot/nxcrm/public/index.php on line 24

解决方法

1、在宝塔设置网站目录中,不要勾选防跨站攻击,问题解决。

2、进入/www/server/nginx/conf目录下,找到fastcgi.conf,修改其中的一个参数’fastcgi_param PHP_ADMIN_VALUE’,没有的话可以自己加一个,/www/wwwroot是你的项目路径,每个人可能都不一样

fastcgi_param PHP_ADMIN_VALUE "open_basedir=/www/wwwroot/:/tmp/:/proc/";

posted on 2023-02-27 18:21  何苦->  阅读(1086)  评论(0)    收藏  举报

导航