dzamanakos

Well-Known Member
Feb 15, 2014
79
6
58
Larisa / Greece
cPanel Access Level
Root Administrator
Hi, when using su_php i experienced a problem where php error log files didnt rotated after reaching 2MB (set in php.ini).

I've recently moved to php-fpm for all accounts and php error files, now located in
/home/user/logs/domain_ext.php.error.log
are getting very large (size of GB, due to warnings logging) and do not get rotated.

Is there a way to keep them at max X mb ?

Best regards,
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
I've recently moved to php-fpm for all accounts and php error files, now located in /home/user/logs/domain_ext.php.error.log are getting very large (size of GB, due to warnings logging) and do not get rotated.
Hello,

Generally, you'd want to address the error messages that are filling up the log files. However, as an alternative, you could reduce the default log level of PHP-FPM to include less information. There's a guide on how to configure custom values for PHP-FPM at:

PHP-FPM configuration settings

In this case, you'd want to adjust the "log_level" parameter from its default "notice" value to "warning" or "error". The other option would be to setup custom logrotate rules for the specific PHP-FPM error logs you want to rotate.

Thank you.