Nginx php-fpm不在任何地方记录500错误 [英] Nginx Php-fpm not logging 500 error anywhere

查看:251
本文介绍了Nginx php-fpm不在任何地方记录500错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

nginx或php-fpm也不报告错误500输出,实际上500响应在访问日志上,而不在nginx错误日志上.该脚本在我的开发环境中运行正常.

Nor do nginx or php-fpm reports a error 500 output, In fact the 500 response is on the access log and not on the nginx error log. The script is running ok in my dev environment.

nginx version: nginx/1.6.2  
PHP 5.5.19 (fpm-fcgi)

尝试过

catch_workers_output = 1

重新启动一切,但仍无法正常工作

Restarted everything, still not working

nginx访问日志显示:

nginx access log shows:

x.x.x.x - - [12/Dec/2014:19:25:08 -0200] "GET /merchant/customer/mobile/data?sEcho=1&iColumns=3&sColumns=%2C%2C&iDisplayStart=0&iDisplayLength=10&mDataProp_0=0&sSearch_0=&bRegex_0=false&bSearchable_0=true&mDataProp_1=1&sSearch_1=&bRegex_1=false&bSearchable_1=true&mDataProp_2=2&sSearch_2=&bRegex_2=false&bSearchable_2=true&sSearch=&bRegex=false&_=1418418256370 HTTP/1.1" 500 589 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36"

请注意500错误,该错误应该出现在error.log上,而其他错误正在发生php跟踪.

Note the 500 error, which should be on error.log and with the php trace that's is happening on other errors.

有任何线索吗?

推荐答案

禁用PHP display_errors时,PHP错误可以返回Nginx 500错误.

When PHP display_errors are disabled, PHP errors can return Nginx 500 error.

看看您的php-fpm日志,我确定您会在此处找到错误.使用CentOS 7:

Take a look into your php-fpm logs, i'm sure you'll find the error there. With CentOS 7 :

tail -f /var/log/php-fpm/www-error.log

您最终可以显示PHP错误.在/etc/php.ini中,更改:

You can finally show PHP errors. In /etc/php.ini, change :

display_errors = Off

至:

display_errors = On

希望有帮助.

这篇关于Nginx php-fpm不在任何地方记录500错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆