Php: Get rid of E_DEPRECATED error messages
I've got E_DEPRECATED error messages even though error_reporting=E_ALL & ~E_DEPRECATED & ~E_STRICT is set in php.ini.
The problem
E_ALL
includes all errors and warnings, as supported, except of level E_STRICT
prior
to PHP 5.4.0. A
comment in php.ini
claims that E_ALL & ~E_NOTICE & ~E_STRICT
will show all errors,
except for
notices and
coding standards warnings. Furthermore it recommends to use E_ALL & ~E_DEPRECATED & ~E_STRICT
in
production
environments. But it didn't work for me: E_DEPRECATED
error messages still showed up.
Solution
On the page PHP Manual:
Predefined Constants you can find all available error constants. If you compose the value
for error_reporting
by using all single constants, you're able to leave any unwanted constant out:
In the line above the constant E_DEPRECATED
is missing. This does the trick for me. Dont' forget to
restart Apache after changing php.ini
.