I'm running ubuntu 10.04 nginx php-fpm 5.4
If I set display_errors = On
in php.ini all errors will be printed. If instead I set it to off and then use ini_set('display_errors, '1'); directly in the script they also show up, but not the parsing errors, just a blank page. I also tried using error_reporting and E_STRICT but I can't find a way!
A few years after this question was answered, here I am, but I have found a solution to this problem. For the script I'm writing, I create a second script that contains the ini_set() directive followed by the includes of the script I
realam working on. This is test_run.php
If you disable
display_errors
inphp.ini
and then enable it in a PHP script usingini_set()
, it will only execute Enabled after the linecontaining the
ini_set() call.Parse Error Occurs before the PHP script is started - while parsing the PHP file (hence the term "parse error") .
This means they occur before your
ini_set()
even has a chance to be executed - which means, in your case, thatdisplay_errors
are not enabled when parsing Error; therefore, you won't display anything.