您的位置:首页 > 运维架构

详解open_basedir 配置项的文件权限问题(使用lnmp一键安装包出现的环境问题)

2017-09-12 19:10 531 查看

解决LNMP开启open_basedir出现"No input file specified"问题

PHP Warning: require(): open_basedir restriction in effect. File(/home/wwwroot/default/laravel/bootstrap/autoload.php) is not within the allowed path(s): (/home/wwwroot/default/laravel/public:/tmp/:/var/tmp/:/proc/) in /home/wwwroot/default/laravel/public/index.php on line 22

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

PHP Fatal error: require(): Failed opening required
'/home/wwwroot/default/laravel/public/../bootstrap/autoload.php'
(include_path='.:/usr/local/php/lib/php') in
/home/wwwroot/default/laravel/public/index.php on line 22

lnmp

chmod -R 777 storage

查看问题描述以及资料,发现是php open_basedir 配置的问题,php不能引入其授权目录上级及其以上的文件,默认配置在php.ini(/usr/local/php/etc/php.ini),但是我的open_basedir 并没有配置,默认被注释了。

文献说可能在服务器配置目录下,如nginx、Apache等,于是用户sublime打开nginx进行全局搜索,open_base,果真还是搜到了,如下图



/usr/local/nginx/conf/fastcgi.conf
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐