0

In the past days, some WordPress websites generate huge error_log in public_html! all websites have cPanel. in all websites that have this problem, those error logs are the same content.

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

I really do not know why this problem? Why suddenly the logs are bulky?

2
  • This would certainly have to be due to some recent change. If you haven't changed anything regarding the Wordpress installation, then there seems to be a good chance your hosting provider changed something. Commented Jul 9, 2019 at 1:26
  • 1
    Problem reason is Litespeed !!! core.trac.wordpress.org/ticket/39338 Commented Jul 20, 2019 at 12:59

1 Answer 1

0

It was happened to me 2 days ago. I searched too much about this and finally i found the solution. You can put below code in public_html/wp-includes/class-wp-hook.php after line 291 (your error code) directory:

while ( is_array( $this->iterations[ $nesting_level ] ) && false !== next( $this->iterations[ $nesting_level ] ) );

This error is too bad and can make 20MB text in a second. I hope that you can solve this.

1
  • Can you comment on what this code is doing and why? Just suggesting to add some piece of code without giving any reference nor explanation is a bit too vague...
    – Ale
    Commented Jul 11, 2019 at 12:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .