Troubleshooting PHP Scripts
From SuperbHosting.net Support Wiki
Troubleshooting PHP Scripts
You can insert the following code block to log all PHP errors to a file:
ini_set('error_reporting', E_ALL);
error_reporting(E_ALL | E_STRICT);
ini_set('log_errors',TRUE);
ini_set('html_errors',FALSE);
ini_set('error_log','/tmp/log_name');
ini_set('display_errors',FALSE);
Be sure to replace log_name with the name of the file you want to use, and possibly place the logs somewhere else than /tmp if you want to store them long-term. Running a tail -f log_name while refreshing the PHP page in a browser will reveal any errors.
