LNMP环境配置Laravel5遇到 open_basedir

今天在git clone公司项目后,

chmod -R 777 bootstrap/

chmod -R 777 storage/

这2个文件设置777权限后,一直报下面的错误:

2017/07/04 09:33:53 [error] 35301#0: *1 FastCGI sent in stderr: "PHP message: PHP Warning:  require(): open_basedir restriction in effect. File(/home/wwwroot/ott/bootstrap/autoload.php) is not within the allowed path(s): (/home/wwwroot/ott/public/:/tmp/:/proc/) in /home/wwwroot/ott/public/index.php on line 21

PHP message: PHP Warning:  require(/home/wwwroot/ott/bootstrap/autoload.php): failed to open stream: Operation not permitted in /home/wwwroot/ott/public/index.php on line 21

PHP message: PHP Fatal error:  require(): Failed opening required '/home/wwwroot/ott/public/../bootstrap/autoload.php' (include_path='.:/usr/local/php/lib/php') in /home/wwwroot/ott/public/index.php on line 21" while reading response header from upstream, client: 10.170.71.233, server: health.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi.sock:", host: "health.com"

搞了半天,终于找到解决 方案:

vim fastcgi.conf

将下面这行,注释

#fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";

然后,重启lnmp

lnmp restart

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容