Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error reporting while running under IIS

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?

like image 677
Marty Avatar asked Jul 31 '09 13:07

Marty


2 Answers

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.

like image 88
MidnightLightning Avatar answered Sep 24 '22 22:09

MidnightLightning


Sorry to resurrect a dead post but I had a similar issue and solved it by doing this in my PHP code:

ini_set('display_errors',1);
error_reporting(E_ALL);

This obviated the need to edit the server config and also allowed me to do this in just the method that I thought was problematic.

like image 24
Andy Avatar answered Sep 22 '22 22:09

Andy