Error reporting while running under IIS

Marty picture Marty · Jul 31, 2009 · Viewed 12.4k times · Source

I am trying to get my install of PHP under IIS to display errors, but I'm having no luck at all. I tried

error_reporting(E_ALL);

in the script, and nothing shows up, just a blank screen.

I tried editing my PHP.ini file and setting

error_reporting = E_ALL
display_errors = On

Also tried

error_reporting = E_ALL
display_errors = stdout

but nothing is showing up on the screen at all when my scripts throw errors.

Any advice?

Answer

MidnightLightning picture MidnightLightning · Jul 31, 2009

Ensure that you're editing the PHP file in the correct location; IIS can look for a php.ini file in C:\WINDOWS rather than the install location of the PHP ISAPI or CGI module. Check the output of phpinfo(); to determine you're editing the correct php.ini file. Also, you need to restart the IIS service (or the computer overall) before those changes will be put into effect.