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

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

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

服务器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了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值