I'm used to serving sites from Apache, but I am now forced to use an IIS server.

A number of my PHP pages are returning error 500 and I can't debug because IIS is suppressing the error messages. I've tried ini_set('display_errors',1); in code but to no avail.

Errors are shown on some sites but not the one in particular that I want to debug so I don't think it is a global PHP setting, but rather something to do with the site settings for that site.

I can't find a clear answer as to how to enable the displaying PHP errors.

I've found this link but am not sure where to find "system.webServer->httpErrors".

How can I enable the displaying errors in PHP under IIS?


How about logging them instead?

Edit php.ini and set

error_reporting = E_ALL & ~E_NOTICE
log_errors = On

And either

error_log = syslog to log to the Windows Event log, or

error_log = location/of/logfile to log to a file.

| improve this answer | |
  • I have error_reporting, log_errors, and error_log all configured this way, but it's still not logging errors for the Joomla site. This site was copied down from an Apache server. I imported the .htaccess rules into IIS 7.5; but alas, it's still failing. Do you by chance have any idea what else I might need to look into? – Mike Perrenoud Nov 15 '13 at 14:05

Assuming you have all the right settings in your php.ini file

  1. Select your website in IIS Manager
  2. On the right, double click Error Pages icon
  3. On far right under 'Actions', click 'Edit Feature Settings' link
  4. On pop up that appears, choose 'Detailed errors' radio button
  5. Refresh your PHP page to see detailed errors

Thanks to last comment on this page

| improve this answer | |

I found out, that it's a good idea to access an IIS-hosted page with InternetExplorer for testing.

In my case the php-error-logs where clean - got no clue from there.

I got a plain non-expressive "500 - internal server error" when connecting with firefox/chrome: enter image description here

...but a more usefult error message ("HTTP Error 500.0 - Internal Server Error C:\PHP\php-cgi.exe - The FastCGI process exited unexpectedly") when using InternetExplorer: enter image description here

Maybe also try connecting on from http://localhost on the server itself.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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