PHP Error Reporting (If site shows blank pages)

If your PHP site is going blank on every page, the reason why is our PHP settings default to hide all PHP errors. Any fatal error will cause the website to go blank.


To fix this error: 

1. Open the file you are editing (chances are it's an index.php) 

2. To display the errors on the page, enter this line of code:

ini_set('display_errors', 1);

3. Add the following right after the opening PHP tag:

ini_set('error_reporting', E_ALL);

4. Then, refresh the page, and that should uncover the PHP errors.


More information is available regarding error_reporting at http://us3.php.net/manual/en/function.error-reporting.php.

Information about runtime configuration can be found at http://www.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting.

Please note
: Even after enabling display_errors and error_reporting in your PHP pages and scripts, parse errors are not displayed unless the flawed code is included into another PHP page.  

Add Feedback