Wordpress error log too big

The error_log file size of my site has been very large. So that it fills the entire server space. The last error in this file:

[06-Jul-2019 13:22:21 UTC] PHP Warning:  current() expects parameter 1 to be array, null given in /home/mysite/public_html/wp-includes/class-wp-hook.php on line 275
[06-Jul-2019 13:22:21 UTC] PHP Warning:  Invalid argument supplied for foreach() in /home/mysite/public_html/wp-includes/class-wp-hook.php on line 277
[06-Jul-2019 13:22:21 UTC] PHP Warning:  next() expects parameter 1 to be array, null given in /home/mysite/public_html/wp-includes/class-wp-hook.php on line 291
[06-Jul-2019 13:22:21 UTC] PHP Warning:  current() expects parameter 1 to be array, null given in /home/mysite/public_html/wp-includes/class-wp-hook.php on line 275
[06-Jul-2019 13:22:21 UTC] PHP Warning:  Invalid argument supplied for foreach() in /home/mysite/public_html/wp-includes/class-wp-hook.php on line 277
[06-Jul-2019 13:22:21 UTC] PHP Warning:  next() expects parameter 1 to be array, null given in /home/mysite/public_html/wp-includes/class-wp-hook.php on line 291
[06-Jul-2019 13:22:21 UTC] PHP Warning:  current() expects parameter 1 to be array, null given in /home/mysite/public_html/wp-includes/class-wp-hook.php on line 275
[06-Jul-2019 13:22:21 UTC] PHP Warning:  Invalid argument supplied for foreach() in /home/mysite/public_html/wp-includes/class-wp-hook.php on line 277
[06-Jul-2019 13:22:21 UTC] PHP Warning:  next() expects parameter 1 to be array, null given in /home/mysite/public_html/wp-includes/class-wp-hook.php on line 291

Someone can help me. What is the problem? (The latest changes we have made on the site: We have used the ACF plugin for add custom fields.)

asked Jul 6, 2019 at 17:00

Wordpress error log too big

2

Turn off the debug error loggins with this command in the wp-config.php file:

define( 'WP_DEBUG', false );

The errors you are seeing are 'warning' (I think of them as 'benign') and have to do with coding practices not allowing for empty 'loop' variables.

You only want the WP_DEBUG to be true on development systems.

If the errors still show up, then look for that setting in the PHP ini file, or in theme or plugin functions.

answered Jul 6, 2019 at 19:16

Rick HellewellRick Hellewell

6,3002 gold badges17 silver badges36 bronze badges

2

Not the answer you're looking for? Browse other questions tagged errors or ask your own question.

Sometimes the WordPress error log file will create huge headache for some users since it creates huge file in some cases. It will sometimes affect the hosting too if you have only less space in your server. In order to avoid logging of error, please add the following code in your wp-config.php file. Add the code below define(‘WP_DEBUG’, false); line.

@ini_set('log_errors','Off'); // enable or disable php error logging (use 'On' or 'Off')
@ini_set('display_errors','Off'); // enable or disable public display of errors (use 'On' or 'Off')

Done, no more error logging now.

This article was last modified on March 15, 2016

Wordpress error log too big

Vipin is the founder and editor of TechRounder. He started his career as a software developer in 2011 and turned towards full-time blogging in 2021. He has a passion for writing on technology, social media, cybersecurity, artificial intelligence, virtual reality, etc. You can contact him via email

  • Should periodically clear/delete these 2 log files:

    /wp-content/uploads/sucuri/sucuri-auditqueue.php
    /wp-content/uploads/sucuri/sucuri-oldfailedlogins.php

    Since sucuri seems to load them anywhere in wp-admin – when they get very big = causes memory_limit exceeded errors:

    PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 4096 bytes) in /home/aaa/public_html/wp-includes/class-wp-recovery-mode.php on line 363
    PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 4096 bytes) in /home/aaa/public_html/wp-content/plugins/sucuri-scanner/src/cache.lib.php on line 260

    At the moment forced to set cron task / delete manually, which is inconvenient for large number of sites.

  • How do I get rid of WordPress error log?

    No errors = no big log file. If that's not an option, you can temporarily disable errors in your log by setting "display_errors" to 0 in your php. ini. If that doesn't work, another option is to set "error_reporting" to 0 .

    How do I change the error log in WordPress?

    How to Enable WordPress Logs to Track Website Errors (In 3 Steps).
    Step 1: Access Your Website's Files. To activate your WordPress logs, you'll need direct access to your site's files. ... .
    Step 2: Edit Your wp-config. php File. ... .
    Step 3: Locate Your New WordPress Logs. Your WordPress logs are now ready to go..

    How do I view WordPress error logs?

    Reviewing Your WordPress Error Logs Once connected, go to /wp-content/ folder and inside it your will find a file called debug. log. You can download, view, or edit this file. It will contain all WordPress errors, warnings, and notices that were logged.

    Can I delete Php_errorlog?

    It is entirely safe to just delete the php. log file. It will be auto-created the next time it is needed.