lnmp环境配置laravel项目白屏问题

本文介绍了解决PHP中因open_basedir限制导致的无法加载文件的问题。通过修改public/.user.ini文件及调整Nginx配置文件fastcgi.conf来解决这一限制,并确保应用正常运行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

开启日志显示:

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

Warning: require(/xxxx/bootstrap/autoload.php): failed to open stream: Operation not permitted in /xxxx/public/index.php on line 22

Fatal error: require(): Failed opening required ‘/xxxx/public/../bootstrap/autoload.php’ (include_path=’.:/usr/local/php/lib/php’) in /xxxx/public/index.php on line 22

修改项目public/.user.ini  open_basedir

chattr -i  ./user.ini    修改为上一级目录,重启无效

查找conf/fastcgi.conf,最后一句

fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";注释掉,重启就可以了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值