Configure PHP to publish error’s detail on remote client

Published on Friday, March 23rd, 2012 by Maurizio Mutti

The problem

As default, after installing php as FastCGI on IIS 7, all exceptions raised into php code will be visible to the visitors of the web site as Http error 500 (internal error).
This behaviour is correct on a public web server, but on a test server we need the errors details.
On a debug server, we need to test the code and to know were and which error occour.

The solution

To tell php to return the original error to the browser, we need to change the FastCGI settings of PHP.
To do this, into IIS Manager:
  • select the server node
  • double click on FastCGI settings
  • pick php-cgi.exe from the list
  • click edit on the right menu bar
  • select “IgnoreAndReturn200” as Standard error mode as shown on the picture.
FastCGI Settings

FastCGI Settings

Share

Leave a Reply