Page 1 of 1

Best PHP error reporting option?

Posted: Fri Jun 15, 2012 7:59 am
by faris
Hi guys,

I can't seem to get the combination I want for php error reporting in php.ini
Can someone guide me please?

At the moment, I'm using

Code: Select all

error_reporting = E_ALL & ~E_DEPRECATED
..but that doesn't do what I want - I'm still getting

Code: Select all

Undefined variable: blah in .....blah....
As far as I can tell, these come under E_NOTICE but I WANT these notices about non-fatal errors in general - I just don't want to know about undefined variables which 99% of scripts seem to have, even today, and which fill up the logs to the brim in some cases.

Is there a way around this? What do other people use for error_reporting?

Re: Best PHP error reporting option?

Posted: Fri Jun 15, 2012 8:43 am
by breun
I don't think there is a way to only log some E_NOTICE messages. For each log level it's either all of nothing.

Re: Best PHP error reporting option?

Posted: Fri Jun 15, 2012 5:15 pm
by faris
Bah :-(

As one of our resident experts on everything, what error_reporting do you use on your systems Breun?

Re: Best PHP error reporting option?

Posted: Fri Jun 15, 2012 6:31 pm
by breun
I'd recommend error_reporting = E_ALL & ~E_DEPRECATED & ~E_NOTICE if you want to keep the size of the logs down in a shared hosting environment.

Re: Best PHP error reporting option?

Posted: Sat Jun 16, 2012 12:35 pm
by faris
Thanks Breun.