Archive | December 2011

How to Set PHP Error Logging in nginx

It took some digging but I found out how to set php error logging in nginx. This is useful if you have virtual hosts or want to log separate sites. Just place the following in the php section of your nginx.conf configuration file and set the path to where you want the logs to be written.

fastcgi_param PHP_VALUE "error_log=/var/log/nginx/host1.php.error.log";

That’s it!