Search code examples
phperror-reporting

Errors not displaying in PHP 5.3


I recently upgraded to PHP 5.3.22 and now I'm getting WSODs whenever there are errors in my php code. I know I have display_errors disabled in php.ini, so I tried adding the following code to the top of my scripts to temporarily enable displaying errors on the screen for debugging.

error_reporting(E_ALL);
ini_set('display_errors', '1');

The above works if I have an undefined function but if I miss a semi-colon at the end of a line, it still displays a WSOD.

How can I get all errors to display on screen when I'm developing the scripts?


Solution

  • Enabling error reporting at run time like that fails to show fatals. You can enable it in your php.ini or add this to your htaccess to override it:

    php_value display_errors 1