error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED

edoriv

Member
Mar 19, 2018
7
0
1
US
cPanel Access Level
Root Administrator
My server is running EA4. Not using FPM. All sites are running PHP7.3

ini_set is disabled so scripts shouldn't be able to alter the error reporting setting.

I have set php 7.0 - 7.3 to use the following via the MultiPHP INI Editor

error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED

However in logs I am still seeing these reported.

These are Wordpress sites... I know there will be warnings and notices it's par for the course with wordpress and too many chefs. They will eventually be fixed by the respective authors.

I want to be aware of and have a log of actual errors... things I may need to take action on.

The logs keep growing out of control because it reports the same errors over and over including that ini_set is disable. Yes I know.... I disabled it in the first place.... Thank you...

I have also set these values to try to slow the error log growth...

ignore_repeated_errors = On
ignore_repeated_source = On

None of the settings appear to alter the reporting activity.
 

verdon

Well-Known Member
Nov 1, 2003
911
10
168
59
Northern Ontario, Canada
cPanel Access Level
Root Administrator
Wordpress core over-rides these values at run-time. I don't remember the detail, but it seems important for some functions. I ultimately created a script and run it via cron that looks for any error_log files beyond a certain size and certain age, and just deletes them.
 

verdon

Well-Known Member
Nov 1, 2003
911
10
168
59
Northern Ontario, Canada
cPanel Access Level
Root Administrator
Here's the script. I have this saved in a file, and cron set to run it once a day.
Code:
#!/bin/bash
find /home/*/ -name "error_log" -size +200k -mtime +5 -type f -not -path "/home/virtfs*" -exec rm {} \;
This deletes any error_log file found in a user home directory that is over 200kb and more than 5 days old, and it stays out off any virtual filesystems (from jailshells)
 

edoriv

Member
Mar 19, 2018
7
0
1
US
cPanel Access Level
Root Administrator
Thanks for the feedback. But as I have previously mention. I don’t allow use of ini_set. There is no way WordPress can alter my settings. I am sure of this because I see in the error logs where WordPress is trying to alter it and I get the warning ini_set is not allowed on this server.

it’s not just a matter of large log size but keeping the logs clear so I can see any actionable problems. If it’s a warning or notice over and over out of my control until a plugin is updated I can’t do much about that but if it’s truly an error not a warning or notice it may be something I can correct. But if all I ever see are a million warning and notices it doesn’t help much.

what’s the point of being able to set the error reporting level if it’s not going to honor the settings?

mom pretty certain something has changed or is overlooked as of ea4 or php7

maybe some further lower level setting that needs tweaking.


I’ll keep your suggestion handy for log size control ;)

thanks
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,749
2,205
363
cPanel Access Level
DataCenter Provider
Twitter
Thanks for the feedback. But as I have previously mention. I don’t allow use of ini_set. There is no way WordPress can alter my settings. I am sure of this because I see in the error logs where WordPress is trying to alter it and I get the warning ini_set is not allowed on this server.
Hello @edoriv,

Could you open a support ticket so we can take a closer look at your system to see what's happening? You can post the ticket number here once it's opened and we'll link this thread to it.

Thank you.