美文网首页PHP经验分享PHP实战
LNMP环境配置Laravel5遇到 open_basedir

LNMP环境配置Laravel5遇到 open_basedir

作者: chinariver | 来源:发表于2017-07-04 09:49 被阅读0次

    今天在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

    相关文章

      网友评论

        本文标题:LNMP环境配置Laravel5遇到 open_basedir

        本文链接:https://www.haomeiwen.com/subject/ocuthxtx.html