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!

Advertisements

Tags:

About rob

PHP, Ajax, Javascript, Java, CSS, XHTML Programmer. Linux Administrator. Microsoft Certified Systems Engineer. Computer Guru.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: