Title: PHP Warning: array_key_exists() in bootstrap.php
Last modified: September 12, 2020

---

# PHP Warning: array_key_exists() in bootstrap.php

 *  Resolved [bjf2000](https://wordpress.org/support/users/bjf2000/)
 * (@bjf2000)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/php-warning-array_key_exists-in-bootstrap-php/)
 * I thought I’d mention this warning which has been appearing in our /public_html/
   error_log since Aug 14, though only three times total in that period. I don’t
   associate it with any particular problem, but it’s probably something you want
   to clear up if it’s not just us.
 * > PHP Warning: array_key_exists() expects parameter 2 to be array, null given
   > in /home/xxxxxxx/public_html/wp-content/plugins/wordfence/waf/bootstrap.php
   > on line 286
 * This is with PHP 7.4.x (latest) currently but 7.3.x back in August.
 * Wordfence is the current version.
 * Wordpress is 5.5.1 but 5.4.x in August.

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

 *  Plugin Support [WFAdam](https://wordpress.org/support/users/wfadam/)
 * (@wfadam)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/php-warning-array_key_exists-in-bootstrap-php/#post-13402713)
 * Hello [@bjf2000](https://wordpress.org/support/users/bjf2000/) and thanks for
   reaching out to us!
 * This sounds like an update might have corrupted a file. Could of either been 
   the PHP upgrade, WordPress upgrade, or Wordfence update. Since the error is located
   in the `waf` folder, I suggest resetting Wordfence to ensure this gets cleaned
   up.
 * You can backup your Wordfence settings via the Export option (**Wordfence > Tools
   > Import/Export Options** and click **Export**. You can also take note of the
   current Whitelisted URLs you have in **Wordfence > Firewall > All Firewall Options
   > Whitelisted URLs** as these are not included in the Import/Export, and will
   be lost during the re-install. Here is what is exported: [https://www.wordfence.com/help/tools/import-export/](https://www.wordfence.com/help/tools/import-export/)
   During the export, you will be given a long string of text. Keep this safe, you’ll
   need it in a few minutes.
 * After that, enable the option to Delete Wordfence tables and data on deactivation
   in **Wordfence > All Options > General Wordfence Options**. You will want to 
   remember to disable this after you reinstall Wordfence again.
 * After you enable that option, you can deactivate Wordfence from the Plugins area
   of your site, then delete it. Next, from the plugins area, search for and re-
   install Wordfence like normal.
 * It will be like setting Wordfence up for the first time. You will need to enter
   an email address, and then go into Wordfence > Tools > Import/Export Options 
   and paste that string of text into the Import Wordfence Options field and click
   the button there.
 * The firewall will be in Learning Mode by default for 7 days. I would recommend
   switching this to “Enabled and Protected” as soon as possible.
 * [https://www.wordfence.com/help/advanced/remove-or-reset/#remove-or-reset](https://www.wordfence.com/help/advanced/remove-or-reset/#remove-or-reset)
   is also a good reference for resetting Wordfence.
 * Let me know if this helps!
 * Thanks!
 *  Thread Starter [bjf2000](https://wordpress.org/support/users/bjf2000/)
 * (@bjf2000)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/php-warning-array_key_exists-in-bootstrap-php/#post-13404104)
 * Before taking that major step, I should emphasize that the warning doesn’t correspond
   to any particular problem that I’ve seen, so it doesn’t seem urgent enough to
   warrant wiping out the installation. That’s typical of PHP warnings as opposed
   to errors.
 * And more to your point of it being corruption, it’s happened with both the current
   and previous version of PHP, current and previous version of WP, current and 
   previous version (maybe versionS) of WordFence. In that case, I’m not sure where
   the corruption, if there is corruption as opposed to a coding issue in bootstrap.
   php, could be.
 *  Plugin Support [WFAdam](https://wordpress.org/support/users/wfadam/)
 * (@wfadam)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/php-warning-array_key_exists-in-bootstrap-php/#post-13404317)
 * Hello again [@bjf2000](https://wordpress.org/support/users/bjf2000/)
 * Can you send a diagnostic report to **wftest @ wordfence . com**? You can find
   the link to do so at the top of the **Wordfence Tools > Diagnostics** page. Then
   click on **“Send Report by Email”**. Please add your forum username where indicated
   and _respond here after you have sent it._
 * Id like to take a look at your data tables and see if I can tell if anything 
   is off.
 * Thanks!
 *  Thread Starter [bjf2000](https://wordpress.org/support/users/bjf2000/)
 * (@bjf2000)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/php-warning-array_key_exists-in-bootstrap-php/#post-13404679)
 * OK, just sent. Thanks.
 *  Plugin Support [WFAdam](https://wordpress.org/support/users/wfadam/)
 * (@wfadam)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/php-warning-array_key_exists-in-bootstrap-php/#post-13404719)
 * Hello again [@bjf2000](https://wordpress.org/support/users/bjf2000/) and thanks
   for sending the diagnostic report!
 * This issue could be related to a broken firewall configuration file, I suggest
   deleting `wflogs` folder under `/wp-content/` directory then reload any of the
   plugin’s settings page to get this folder regenerated, after that, recheck this
   issue and let me know how it goes.
 * Don’t forget to switch the firewall into “Enabled and Protecting” after doing
   this step.
 * Let me know if this resolves it. If not, we might have to manually reinstall 
   the plugin to correct the issue.
 * Thanks again!
 *  Thread Starter [bjf2000](https://wordpress.org/support/users/bjf2000/)
 * (@bjf2000)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/php-warning-array_key_exists-in-bootstrap-php/#post-13404766)
 * OK, I’ll do that later today.
 * Due to the infrequency of these warnings in the log (three weeks between the 
   first one and the recent pair from five days ago), it could be quite some time
   before anything is known.
 *  Plugin Support [WFAdam](https://wordpress.org/support/users/wfadam/)
 * (@wfadam)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/php-warning-array_key_exists-in-bootstrap-php/#post-13404893)
 * Sounds good [@bjf2000](https://wordpress.org/support/users/bjf2000/)
 * If you are still seeing this issue even weeks down the road, please try to reinstall
   Wordfence given the instructions here. If you are still having issues, as always,
   feel free to post another topic and we would be glad to assist you!
 * Thanks again for your support!

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

The topic ‘PHP Warning: array_key_exists() in bootstrap.php’ is closed to new replies.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)

 * 7 replies
 * 2 participants
 * Last reply from: [WFAdam](https://wordpress.org/support/users/wfadam/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/php-warning-array_key_exists-in-bootstrap-php/#post-13404893)
 * Status: resolved