Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using IIS as a webserver on my development machine for PHP webdevelopment. Or at least, I am trying to.

When there is a syntax error in a PHP script and I open that file in my webbrowser, I just get an 503 "internal server error" and the default IIS error page for this error. Some browsers dont open that file at all, possibly because of the 503 HTTP Response Header.

I would like IIS to act in that case just like the apache webserver: display the PHP file with the error anyway, so that the error message gets printed out.

How can this be done?


PHP settings:


is on and


is set to E_ALL

share|improve this question
up vote 4 down vote accepted

With IIS7, it doesn't pass the errors through by default. It's "existingResponse" that needs to be set.

You can set it by running the following (make sure to replace {sitename} with your site name).

c:\windows\system32\inetsrv\appcmd.exe set config "{sitename}" -section:system.webServer/httpErrors /existingResponse:"PassThrough" /commit:apphost

share|improve this answer
I tried this and Sam Cogans suggestion - it tells me the changes are done, but I still receive a "internal server error" instead of the php sript with error messages. Why did it not work? – Max Oct 1 '09 at 15:29
Also turn off friendly error pages in IE if you haven't already. (Tools->Internet Options->Advanced) That can also mask the real message and is likely the secondary issue that you're running into now. – Scott Forsyth - MVP Oct 1 '09 at 21:09

A best practice would be to log "silently" in a file.

But you can have both by setting the following value in your php.ini file to a logfile

error_log=<File Location>
share|improve this answer
>> A best practice would be to log "silently" in a file. Not necessarily. There is nothing wrong with displaying errors on an internal development server. Just don't do it on your live server. – user171032 Apr 24 '13 at 18:54

Include the following two lines at the top of your PHP script


error_reporting(E_ALL | E_STRICT);
share|improve this answer

In your php.ini set:

error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT
display_errors = On

And if you want them logged:

log_errors = On
share|improve this answer
Sorry, forgot to mention: PHP is configured to report and display errors. See my edit. – Max Sep 30 '09 at 6:29

To enable detailed errors for PHP (and other languages), run this command from the command line:

%windir%\system32\inetsrv\appcmd.exe set config -Section:system.webServer/httpErrors -errorMode:Detailed


share|improve this answer

protected by Sven Jul 20 '15 at 17:28

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.