Php – Nginx Php-fpm not logging 500 error anywhere

nginxPHP

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)

Tried this

catch_workers_output = 1

Restarted everything, still not working

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"

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

Any clues?

Best Answer

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

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

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

display_errors = Off

to :

display_errors = On

Hope it helps.

Related Topic