Link to home
Start Free TrialLog in
Avatar of stargateatlantis
stargateatlantis

asked on

php.ini hide notices and warnings

In my php.ini I am trying to show errors only but not warnings.  Her is some settings I have below.

display_errors = On

and

error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING

But notices and warnings still show up
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Those constants may or may not work.  Check this link.
http://php.net/manual/en/configuration.changes.php

See also: http://php.net/manual/en/errorfunc.configuration.php#ini.error-reporting
What you might want to do is log errors, warnings and notices, but not show any of them to clients.  Maybe something like this:

error_reporting = 32767
display_errors = Off
log_errors = On
log_errors_max_len = 1024
error_log = error_log

If you want a script that can find the error logs, just post back and I'll put it here.
Avatar of stargateatlantis
stargateatlantis

ASKER

So this will disable show warnings
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial