Back to ITRS Internal Only FAQ

Internal documentation only

This page has been marked as draft.

"/var/log/php-fpm/www-error.log" filling up disk space

Problem: Log contains thousands of lines like this creating huge www-error.log files

PHP Warning:  mb_detect_encoding() expects parameter 1 to be string, array given in /opt/monitor/op5/api/lib/response.php on line 400

Solution Copied

Prior to V9.7, below are the steps to mitigate repeated logging.

For the config files update to reduce/disable logs, you should be able to control logging output by editing config file and restarting php-fpm.

Update config:

vi /etc/php-fpm.d/www.conf

And add:

php_admin_flag[ignore_repeated_errors] = on

This will log the errors only once per API call. This is the recommendation first if the log file is manageable before we fix the issue. It’s also probably safe to retain after the issue is resolved, and we will also check if this can be the default option for our PHP applications.

OR (if needed)

;E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_WARNING
php_admin_value[error_reporting] = 22525

Reference: https://www.php.net/manual/en/errorfunc.constants.php

This will disable all logging of warnings in php-fpm (E_DEPRECATED/E_STRICT are disabled by default in /etc/php.ini). This will likely be better off to be removed once we have resolved the issue to aid in debugging of future problems.

After the config files have been updated, restart php-fpm.

systemctl restart php-fpm

Fixed has been implemented in V9.7 (issue ID MON-13337) Release notes: Please refer to this link.

["Geneos"] ["FAQ"]

Was this topic helpful?