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?
EDIT:
PHP settings:
display_errors
is on and
error_reporting
is set to E_ALL
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).
To enable detailed errors for PHP (and other languages), run this command from the command line:
Then
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
Include the following two lines at the top of your PHP script
In your php.ini set:
And if you want them logged: