首页 > 编程语言 >php laravel 宝塔 访问报错 Warning: require(): open_basedir restriction in effect.

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

时间:2023-02-27 18:34:41浏览次数:38  
标签:laravel restriction www wwwroot nxcrm 报错 php open public

错误信息

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/";

标签:laravel,restriction,www,wwwroot,nxcrm,报错,php,open,public
From: https://www.cnblogs.com/fuqian/p/17161416.html

相关文章