Laravel – 从 laravel 的报错说起:open_basedir restriction in effect
先说结果:修改了fastcgi.conf中的配置解决问题。
服务器环境用lnmp自动安装的,头一次访问laravel的时候,报500错误,打开日志看了看,报错如下:
1 2 3 4 5 |
[23-May-2018 12:21:23 PRC] PHP Warning: require(): open_basedir restriction in effect. File(/data/.composer/vendor/testapp/vendor/autoload.php) is not within the allowed path(s): (/data/.composer/vendor/testapp/public/:/tmp/:/proc/) in /data/.composer/vendor/testapp/public/index.php on line 28 [23-May-2018 12:21:23 PRC] PHP Warning: require(/data/.composer/vendor/testapp/vendor/autoload.php): failed to open stream: Operation not permitted in /data/.composer/vendor/testapp/public/index.php on line 28 [23-May-2018 12:21:23 PRC] PHP Fatal error: require(): Failed opening required '/data/.composer/vendor/testapp/public/../vendor/autoload.php' (include_path='.:/usr/local/php/lib/php') in /data/.composer/vendor/testapp/public/index.php on line 28 |
看了看,大概意思是这样:
1,域名的根目录是:/[……]