项目部署到服务器显示 网页无法访问500 错误的解决办法

本文详细介绍了如何通过修改php.ini配置文件解决PHP-FPM启动失败的问题,并提供了具体的错误信息解决方案,包括如何处理open_basedir限制导致的警告与错误。

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

在这里插入图片描述

标题 第一步进行php.ini文件的更改

// 把php.ini 文件中的Off 更改为下方On
display_errors = On
display_startup_errors = On

运行一下 : php - fpm
报下面的提示信息请:删除 php-cgi.sock 在运行php - fpm

[05-Jun-2019 13:11:00] ERROR: An another FPM instance seems to already listen on /tmp/php-cgi.sock
[05-Jun-2019 13:11:00] ERROR: FPM initialization failed

如果运行报一下错误

(我的这边是TP的报错,Lravel和在下面的错误大致相同,解决办法都是一样的)
Warning: require(): open_basedir restriction in effect. File(/www/wwwroot/tp5.test.com/tp5/thinkphp/start.php) is not within the allowed path(s): (/www/wwwroot/tp5.test.com/tp5/public/:/tmp/:/proc/) in /www/wwwroot/tp5.test.com/tp5/public/index.php on line 17

Warning: require(/www/wwwroot/tp5.test.com/tp5/thinkphp/start.php): failed to open stream: Operation not permitted in /www/wwwroot/tp5.test.com/tp5/public/index.php on line 17

我的服务器是nginx的 nginx的配置文件

找到 usr/local/nginx/fastcgi.conf
显示部分直接复制粘贴及可 注释掉原来的部分!

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

重启 nginx -s reload


**以上部分属于个人采坑 ,希望对你有帮助!** *属于个人原创*
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值