Best PHP error reporting option?

Support/Development for PHP
faris
Long Time Forum Regular
Long Time Forum Regular
Posts: 2321
Joined: Thu Dec 09, 2004 11:19 am

Best PHP error reporting option?

Unread post 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?
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Re: Best PHP error reporting option?

Unread post 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.
Lemonbit Internet Dedicated Server Management
faris
Long Time Forum Regular
Long Time Forum Regular
Posts: 2321
Joined: Thu Dec 09, 2004 11:19 am

Re: Best PHP error reporting option?

Unread post by faris »

Bah :-(

As one of our resident experts on everything, what error_reporting do you use on your systems Breun?
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Re: Best PHP error reporting option?

Unread post 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.
Lemonbit Internet Dedicated Server Management
faris
Long Time Forum Regular
Long Time Forum Regular
Posts: 2321
Joined: Thu Dec 09, 2004 11:19 am

Re: Best PHP error reporting option?

Unread post by faris »

Thanks Breun.
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
Post Reply