IIS not displaying detailed PHP errors - shows server fault 500 instead
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?
Solution 1:
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.
Solution 2:
Assuming you have all the right settings in your php.ini file
- Select your website in IIS Manager
- On the right, double click Error Pages icon
- On far right under 'Actions', click 'Edit Feature Settings' link
- On pop up that appears, choose 'Detailed errors' radio button
- Refresh your PHP page to see detailed errors
Thanks to last comment on this page
Solution 3:
If you are using php with IIS:
- Select your website in IIS
- Select PHP Manager.
- Select Configure error reporting.
- Select Developer machine.
- Hit Apply on the far top right in Action panel.