PHP and IIS7 using FastCGI – HTTP 500 error

Posted by p_lider December 18th, 2012

When you install a php into IIS7 and try to execute phpinfo() script you can get an HTTP 500 Internal Server Error message. The most probably cause of this is that php-cgi.exe program is writing some text to stderr. By default IIS7 displays an HTTP 500 error message when it detects such behavior even, when the CGI displayed only a warning message on stderr. To avoid this problem you have to change default error handling for FastCGI in IIS7.

To do this follow the following steps:

  1. Start IIS Manager
  2. Click on <server name> and then in the right pane go to “FastCGI Settings”.
  3. Right click on php-cgi.exe file and choose “Edit…”.
  4. Set the “Standard error mode” option to “IgnoreAndReturn200” value.
  5. Click OK and close IIS Manager.

After performing mentioned steps you shall no longer see HTTP 500 error messages in the browser.

4 Responses

  1. Vasan says:

    Really thanks, now it works fine.

  2. Ando says:

    Boom! Exactly what I needed. Thanks, man. :)

  3. Brian says:

    You rock, this was exactly what I needed. Thank you!

  4. Lardi says:

    Thanks dude, after googling for two days.