I’m running ubuntu 10.04 + nginx + php-fpm 5.4
If I set display_errors = On in php.ini all errors are printed. If Instead I set that to off and then use ini_set(‘display_errors, ‘1’); directly in the script they will show as well but not the parse errors, just a blank page. I tried to play with error_reporting too and E_STRICT but I couldn’t find a way!
If you disable
display_errorsinphp.ini, and later enable it in your PHP script usingini_set(), it will only be enabled after the line containing thatini_set()call has been executed.Parse errors occur before the PHP script even starts — when the PHP file is parsed (hence the “parse error” name).
Which means they occur before your
ini_set()has even a chance of being executed — which means that, in your case,display_errorsis not enabled when the parse error occurs ; and, as a consequence, you don’t get anything displayed.