We're running PHP 5.2.5 on an IIS 7 Server and we're having problems making PHP errors visible... At the moment whenever we have a PHP error the server sends back a 500 error with the message "The page cannot be displayed because an internal server error has occurred."

This might be a good setting for production websites but it's rather annoying on a development server... ;-)

I have tried configuring php.ini to display errors to the screen as well as log them to a specific folder but it seems that the Server catches all errors before and prevents and handling by PHP...

Does someone know what we have to do to make IIS display PHP errors on screen? Any links, tipps or tutorials on the subject would be appreciated!

  • First, ensure that you have these: log_errors=1, error_reporting=-1, log_errors_max_len=0.
    – Pacerier
    Commented Aug 27, 2015 at 17:05
  • 1
    ini_set("display_errors", "on"); add these lines in php file.
    – ELITE
    Commented Feb 28, 2016 at 6:20

6 Answers 6


Just to double check, do you have logging set to error_reporting = E_ALL, and display_errors = On in your php.ini? Usually this is enough to display these errors in IIS 7.

Next, take a look at your IIS settings, as it may be set to only show error messages locally. In the IIS 7 configuration editor this is under system.webServer->httpErrors. You will need to change errorMode to Detailed from DetailedLocalOnly. Obviously this now means anyone browsing your site will be able to see the error.

enter image description here

enter image description here

Alternatively, if you want to keep them local you can use Remote Desktop to log in to the server and run the app from there, if you can.

  • 1
    Yes I checked and that's all configured properly.
    – Ben
    Commented Jun 4, 2009 at 10:29
  • Added some more troubleshooting info
    – Sam Cogan
    Commented Jun 4, 2009 at 10:37
  • 2
    Changing the errorMode to "Detailed" from "DetailedLocalOnly" did the trick. Thanks!
    – Ben
    Commented Jun 4, 2009 at 12:37
  • 1
    I had to remove the collection of HTTP errors under system.webServer as well. Didn't work with PHP until I did.
    – user121207
    Commented May 16, 2012 at 3:36
  • 1
    Please highlight that system.webServer with my blood and add note: "Yes, there is combo".
    – DiGi
    Commented May 22, 2012 at 12:39

Just wanted to add, that "existingResponse" should be set to "PassThrough". I didn't get any real error messages without that additional setting.

  • 1
    Where is located this setting? Commented Jun 25, 2018 at 18:02

You can do this easily using the IIS Manager GUI. Select your Site and double-click Error Pages. Then hit 'Edit Feature Settings...' and select the 'detailed errors' option instead of the default 'detail errors for local requests and custom error pages for remote requests'. Voilà, simple as that!

  • Where can the logs and errors be shown then?
    – JukEboX
    Commented Nov 3, 2016 at 13:24

I had to go into the settings on the webserver into php configuration and there is a setting in there for error reporting and is set to production by default. Had to change it to development even after changing the php.ini and the suggestion here. I am using iis 7.5 on 2008 R2.


I tried these and it did not work. Specifically "Configuration editor" I needed to keep "existing Response" to "auto".

However I found that if you use FastCGI you need to go into IIS manager -> default web site -> FastCGI-> then select c:\php\php-cgi-.exe and "edit..".

Under "Standard error mode" you need to change ReturnGeneric500 to ReturnStdErrIn500

This will display the PHP errors if you have them turned on in PHP.INI or through settings in PHP code.


If you're like me on a shared hosting platform, without access to IIS manager, you can also edit the web.config file and manually add to the system.webServer element:

<httpErrors errorMode="Detailed" />

Afterwards I used my host control panel to recycle application pool.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .