Title: class-wp-hook.php generating errors, crashing server
Last modified: July 7, 2018

---

# class-wp-hook.php generating errors, crashing server

 *  [tommybutter](https://wordpress.org/support/users/tommybutter/)
 * (@tommybutter)
 * [8 years ago](https://wordpress.org/support/topic/class-wp-hook-php-generating-errors-crashing-server/)
 * Last week randomly we started encountering errors with class-wp-hook.php, no 
   updates that I know of had been run, error log reads:
 * [01-May-2018 00:51:11 UTC] PHP Warning: array_keys() expects parameter 1 to be
   array, integer given in /public_html/wp-includes/class-wp-hook.php on line 271
   [
   01-May-2018 00:51:11 UTC] PHP Warning: current() expects parameter 1 to be array,
   null given in /public_html/wp-includes/class-wp-hook.php on line 275 [01-May-
   2018 00:51:11 UTC] PHP Warning: Invalid argument supplied for foreach() in /public_html/
   wp-includes/class-wp-hook.php on line 277 [01-May-2018 00:51:11 UTC] PHP Warning:
   next() expects parameter 1 to be array, null given in /public_html/wp-includes/
   class-wp-hook.php on line 291 [01-May-2018 00:51:11 UTC] PHP Warning: current()
   expects parameter 1 to be array, null given in /public_html/wp-includes/class-
   wp-hook.php on line 275 [01-May-2018 00:51:11 UTC] PHP Warning: Invalid argument
   supplied for foreach() in /public_html/wp-includes/class-wp-hook.php on line 
   277 [01-May-2018 00:51:11 UTC] PHP Warning: next() expects parameter 1 to be 
   array, null given in /public_html/wp-includes/class-wp-hook.php on line 291 [
   01-May-2018 00:51:11 UTC] PHP Warning: current() expects parameter 1 to be array,
   null given in /public_html/wp-includes/class-wp-hook.php on line 275 [01-May-
   2018 00:51:11 UTC] PHP Warning: Invalid argument supplied for foreach() in /public_html/
   wp-includes/class-wp-hook.php on line 277 [01-May-2018 00:51:11 UTC] PHP Warning:
   next() expects parameter 1 to be array, null given in /public_html/wp-includes/
   class-wp-hook.php on line 291 [01-May-2018 00:51:11 UTC] PHP Warning: current()
   expects parameter 1 to be array, null given in /public_html/wp-includes/class-
   wp-hook.php on line 275 [01-May-2018 00:51:11 UTC] PHP Warning: Invalid argument
   supplied for foreach() in /public_html/wp-includes/class-wp-hook.php on line 
   277
 * This cascades on for several hundred lines before the server maxes IO and crashes
   with a 503 error. I have tried googling for similar errors for fixes but most
   people who have had a similar error haven’t had a repeating error like this and
   it usually pointed to a specific plugin. I am at a bit of a loss.
 * Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [8 years ago](https://wordpress.org/support/topic/class-wp-hook-php-generating-errors-crashing-server/#post-10240468)
 * Sorry to hear of your troubles. There’s nothing wrong with WP_Hook class, except
   maybe not being tolerant of being passed inappropriate data. Used correctly, 
   it works fine. So we need to track down what is using it incorrectly. Please 
   install and activate the [health-check](https://wordpress.org/plugins/health-check/)
   plugin. Check the main tab for possible issues. Then invoke the troubleshooting
   mode. You should find no errors occurring in this mode.
 * Next, reactivate your theme and plugins one by one, using the troubleshooting
   admin bar item. Test after each activation. When the errors recur, the last activated
   module is causing the problem by using WP_Hook incorrectly. Take up the issue
   with the responsible authors of that module.
 *  [microbit](https://wordpress.org/support/users/microbit/)
 * (@microbit)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/class-wp-hook-php-generating-errors-crashing-server/#post-10380591)
 * I have the same issue.
    I installed Health Check plugin, and deactivated all 
   plugins and activated default theme too. but there is nothing changed. Cpanel
   I/O still is 100% and log file is loging report too fast that errors:
 *     ```
       current() expects parameter 1 to be array, null given in /home/------/public_html/wp-includes/class-wp-hook.php on line 275
       Cannot use a scalar value as an array in /home/------/public_html/wp-includes/class-wp-hook.php on line 275
       Cannot use a scalar value as an array in /home/-------/public_html/wp-includes/class-wp-hook.php on line 291
       ```
   
    -  This reply was modified 7 years, 11 months ago by [microbit](https://wordpress.org/support/users/microbit/).
 *  [breakoftheec](https://wordpress.org/support/users/breakoftheec/)
 * (@breakoftheec)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/class-wp-hook-php-generating-errors-crashing-server/#post-10435013)
 * There is an issue with the WP Hook Class.
    It’s been discussed before, but WordPress
   don’t seem to care to acknowledge the reality of the open plugins nature, and
   that is that there are a lot of less than perfect plugins out there.
 * See this thread:
    [https://core.trac.wordpress.org/ticket/39338](https://core.trac.wordpress.org/ticket/39338)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘class-wp-hook.php generating errors, crashing server’ is closed to new
replies.

## Tags

 * [class-wp-hook](https://wordpress.org/support/topic-tag/class-wp-hook/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 4 participants
 * Last reply from: [breakoftheec](https://wordpress.org/support/users/breakoftheec/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/class-wp-hook-php-generating-errors-crashing-server/#post-10435013)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
