error_reporting in php
A client whose PHP code generates a mountain of warnings needs to disable the warnings in the error_log file so that it does not grow uncontrollably.
We put this line with the MultiPHP INI Editor.
error_reporting = "E_ALL & ~E_WARNING"
After this we find a problem, although the warnings on the screen disappear, the error_log file is no longer generated. Not even when there is a critical error. We only want there to be no warnings within error_log, but all other errors. Are we doing something wrong?
Thanks!
-
Hello!
I tried to put only this and still all the error reports disappear, on the screen and error_log
error_reporting "E_ALL"
0 -
Hello,
Reading the https://www.php.net/manual/en/function.error-reporting.php page, it looks like what you want iserror_reporting "~E_WARNING"
The tilde character means NOT. So do NOT report warnings.
0 -
I think it must be:
error_reporting = E_ALL & ~E_NOTICEerror_reporting is an integer value, and E_ALL and E_NOTICE are predefined constants.
0 -
Hello!
cPanelPeter I tried but the same thing happens to me. The error_log file stops being generated, not even with other errors.
quietFinn I have to put it in quotes because cPanel also saves this in .htaccess and if it doesn't have quotes, the website gives an error 500.0
Please sign in to leave a comment.
Comments
4 comments