title: How to display PHP errors when using Lighttpd and Fast-CGI?
body: <p>I'm running a Lighttpd webserver using FastCGI and the webserver does not output PHP Parse Errors.</p>
  
  <p>My php.ini file has the following settings:</p>
  
  <pre><code>error_reporting = E_ALL
  display_errors = Off
  display_startup_errors = Off
  log_errors = On
  html_errors = On
  </code></pre>
  
  <p>I enable error output for development in my PHP scripts like this ( with redundancy for other environments ):</p>
  
  <pre><code>error_reporting( E_ALL );
  ini_set( 'display_errors', 1 );
  ini_set( 'html_errors', 'On' );
  </code></pre>
  
  <p>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 ):</p>
  
  <pre><code>&lt;?php echo 'foo' 'bar'; ?&gt;
  </code></pre>
  
  <p>I've discovered that if I set <code>display_errors = On</code> in php.ini then parse errors output correctly with FastCGI and Lighttpd, but then I cannot turn them off within my PHP scripts using <code>ini_set( 'display_errors', 0 )</code>.</p>
  
  <p>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?</p>