FastCGI sent in stderr: "PHP message: PHP Fatal error

从PHP7.2升级到7.4后解决网站访问错误的问题
在升级PHP版本后,网站无法访问,nginx错误日志显示PHP反射异常。问题出在vendor和缺少fileinfo扩展,通过安装fileinfo扩展并调整php.ini中的disable_functions解决了这个问题。之后因proc_open被禁用再次遇到问题,删除php.ini中的putenv后,执行composerinstall成功,网站恢复正常。

服务器php7.2卸载安装7.4之后,打开网站一直无法访问,查看nginx错误日志发现一直报这个错误:

2023/02/23 11:12:55 [error] 4735#0: *21 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught ReflectionException: Class translator does not exist in /www/wwwroot/dev_admin/vendor/laravel/framework/src/Illuminate/Container/Container.php:779

排查怀疑是vendor问题,于是执行 composer install结果报错如下

原来是缺少fileinfo扩展

解决方案:安装fileinfo扩展

再执行composer install 报错如下

php.ini文件里面的,proc_open删除

再执行composer install 报错如下

表示 php 中,函数 proc_open 禁用了,需要在 php.ini 禁用函数 disable_functions 中删除这个函数,将php.ini文件里面的putenv删除

再执行composer install

执行完毕,再访问网站ok了

2025/06/23 14:14:53 [error] 185042025/06/23 14:14:53 [error] 18504#0: *40688 FastCGI sent in stderr:PHP message: PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 991232 bytes) in /home/data/baota/wwwroot/yijian.sdhuan.cn/vendor/monolog/monolog/src/Monolog/Logger.php on line 329 PHP message: PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) in /home/data/baota/wwwroot/yijian.sdhuan.cn/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php on line 202" while reading response header from upstream, client: 223.104.194.134, server: yijian.sdhuan.cn, request: "POST /addons/yun_shop/api.php?i=1&uuid=0&type=5&shop_id=null&basic_info=1&validate_page=1&scope=home&route=meal.home.getHomeFirstCategory HTTP/2.0", upstream:fastcgi://unix:/tmp/php-cgi-72.sock:", host: "yijian.sdhuan.cn", referrer: "https://yijian.sdhuan.cn/addons/yun_shop/?menu=" 2025/06/23 14:14:53 [error] 18504#0: *40688 FastCGI sent in stderr:PHP message: PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 991232 bytes) in /home/data/baota/wwwroot/yijian.sdhuan.cn/vendor/monolog/monolog/src/Monolog/Logger.php on line 329 PHP message: PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) in /home/data/baota/wwwroot/yijian.sdhuan.cn/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php on line 202" while reading response header from upstream, client: 223.104.194.134, server: yijian.sdhuan.cn, request: "POST /addons/yun_shop/api.php?i=1&uuid=0&type=5&shop_id=null&validate_page=1&scope=home&route=meal.home.getHomeThirdCategory HTTP/2.0", upstream:fastcgi://unix:/tmp/php-cgi-72.sock:", host: "yijian.sdhuan.cn", referrer: "https://yijian.sdhuan.cn/addons/yun_shop/?menu=" 2025/06/23 14:14:53 [error] 18504#0: *40688 FastCGI sent in stderr:PHP message: PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 991232 bytes) in /home/data/baota/wwwroot/yijian.sdhuan.cn/vendor/monolog/monolog/src/Monolog/Logger.php on line 329 PHP message: PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) in /home/data/baota/wwwroot/yijian.sdhuan.cn/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php on line 43" while reading response header from upstream, client: 223.104.194.134, server: yijian.sdhuan.cn, request: "POST /addons/yun_shop/api.php?i=1&uuid=0&type=5&shop_id=null&validate_page=1&scope=home&route=coupon.member-coupon.coupons-for-member HTTP/2.0", upstream:fastcgi://unix:/tmp/php-cgi-72.sock:", host: "yijian.sdhuan.cn", referrer: "https://yijian.sdhuan.cn/addons/yun_shop/?menu="报错是什么意思,怎么解决
06-24
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值