How-to – Manage PHP error log


Just add following line to /etc/php.ini to log errors to specified file – /var/log/php-scripts.log

# vi /etc/php.ini

Modify error_log directive

error_log = /var/log/php-scripts.log

Make sure display_errors set to Off (no errors to end users)

display_errors = Off

Save and close the file. Restart web server:

# /etc/init.d/httpd restart

Assign the correct permission to the file php-scripts.log. It needs to be writable by web user (like www-data).