I'm running a Lighttpd webserver using FastCGI and the webserver does not output PHP Parse Errors.
My php.ini file has the following settings:
error_reporting = E_ALL
display_errors = Off
display_startup_errors = Off
log_errors = On
html_errors = On
I enable error output for development in my PHP scripts like this ( with redundancy for other environments ):
error_reporting( E_ALL );
ini_set( 'display_errors', 1 );
ini_set( 'html_errors', 'On' );
Most errors output fine. Parse Errors do not. Below is example code that throws a parse error. The error is not outputted by the Lighttpd webserver but is when executed from the command line because it's not using FastCGI. ( notice the missing concatenation operator ):
<?php echo 'foo' 'bar'; ?>
I've discovered that if I set display_errors = On
in php.ini then parse errors output correctly with FastCGI and Lighttpd, but then I cannot turn them off within my PHP scripts using ini_set( 'display_errors', 0 )
.
I'd like to be able to display these within my application when developing it, and be able to turn them off for production without changing php.ini configurations. Is there no way to do this within my PHP application when using FastCGI?