当前位置:博客首页>>nginx >> 阅读正文

lnmp集成环境运行laravel报open_basedir restriction in effect的错误

作者: 郑晓 分类: nginx 发布于: 2017-08-02 10:03 浏览:5,771 没有评论


使用lnmp集成环境在运行laravel时显示空白,打开php.ini的display_errors后显示:
open_basedir restriction in effect…. is not within the allowed path…的错误。
这是服务器把include权限限制在了open_basedir所设置的目录。

检查php.ini发现open_basedir确实是限制在项目的public下,所以在包含上级其它目录中的文件时会出错。

由于php.ini中检查过open_basedir是被注释的,所以不是php.ini的锅。

依次检查nginx虚拟机的conf及其所包含的一些conf文件,发现在/usr/local/nginx/conf/fastcgi.conf中最后一行有一句:

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

所以锅就在这里了,把这行注释或删除,重启nginx,问题解决。

       

本文采用知识共享署名-非商业性使用 3.0 中国大陆许可协议进行许可,转载时请注明出处及相应链接。

本文永久链接: https://www.zh30.com/lnmp-laravel-open_basedir.html

发表评论

change vcode