This is an old revision of the document!


Stderr.log outputs many PHP warning messages which consume a lot of disks

A user is seeing the server's main stderr.log growing very fast and are filling up the disk space rapidly.

34G /var/log/apache2/stderr.log.2019_01_07
6.1G /var/log/apache2/stderr.log.2019_01_07.01
6.3G /var/log/apache2/stderr.log.2019_01_07.02
6.0G /var/log/apache2/stderr.log.2019_01_07.03
5.7G /var/log/apache2/stderr.log.2019_01_07.04
6.2G /var/log/apache2/stderr.log.2019_01_08
6.0G /var/log/apache2/stderr.log.2019_01_08.01
6.2G /var/log/apache2/stderr.log.2019_01_08.02
6.2G /var/log/apache2/stderr.log.2019_01_08.03
36G /var/log/apache2/stderr.log.2019_01_08.04
6.2G /var/log/apache2/stderr.log.2019_01_08.05
5.8G /var/log/apache2/stderr.log.2019_01_08.06
5.9G /var/log/apache2/stderr.log.2019_01_09

By checking the stderr.log, there are many PHP warning messages:

PHP Warning: next() expects parameter 1 to be array, null given in /home// /wp-includes/class-wp-hook.php on line 291
PHP Warning: current() expects parameter 1 to be array, null given in /home// /wp-includes/class-wp-hook.php on line 275
PHP Warning: Invalid argument supplied for foreach() in /home// /wp-includes/class-wp-hook.php on line 277
PHP Warning: next() expects parameter 1 to be array, null given in /home// /wp-includes/class-wp-hook.php on line 291

The PHP warning messages are from different shared hosting users but all logged to the main server stderr.log log. We believe the excessive stderr log is due to PHP change: PHP engine generates a lot of error/warning messages.

How to stop this?

Please upgrade to the latest build of 5.3.5 and above, and disable stderr Log settings ( LSWS Admin Panel → Server → Log → Enable stderr Log → No).

The latest LSWS version should stop such PHP warming output to stderr.log.

If you only want to stop PHP related error/warning reporting in stderr.log, you can add special environment variable to lsphp external application configuration:

LSAPI_STDERR_LOG=/dev/null

It can discard PHP generated log message.

  • Admin
  • Last modified: 2019/01/21 18:58
  • by Jackson Zhang