Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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!

share|improve this question

2 Answers 2

up vote 19 down vote accepted

Just to double check, do you have logging set to E_ALL, and display_errors enabled 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.

Alternatively, if you want to keep them local you can RDP to the server and run the app from there, if you can.

share|improve this answer
    
Yes I checked and that's all configured properly. –  Ben Jun 4 '09 at 10:29
    
Added some more troubleshooting info –  Sam Jun 4 '09 at 10:37
1  
Changing the errorMode to "Detailed" from "DetailedLocalOnly" did the trick. Thanks! –  Ben Jun 4 '09 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 May 16 '12 at 3:36
1  
Please highlight that system.webServer with my blood and add note: "Yes, there is combo". –  DiGi May 22 '12 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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