Title: PHP Errors with WP Engine
Last modified: August 27, 2020

---

# PHP Errors with WP Engine

 *  Resolved [Roger](https://wordpress.org/support/users/elleirdad/)
 * (@elleirdad)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/php-errors-with-wp-engine/)
 * I am getting these PHP errors when using WordFence on WPEngine. What can be done
   to help?
 * PHP Warning: fopen(/nas/content/live/karenallenfa/wp-content/wflogs/rules.php):
   failed to open stream: No such file or directory in /nas/content/live/karenallenfa/
   wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 
   325
    Warning: fopen(/nas/content/live/karenallenfa/wp-content/wflogs/rules.php):
   failed to open stream: No such file or directory in /nas/content/live/karenallenfa/
   wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 
   325 PHP Warning: flock() expects parameter 1 to be resource, bool given in /nas/
   content/live/karenallenfa/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/
   src/lib/waf.php on line 326 Warning: flock() expects parameter 1 to be resource,
   bool given in /nas/content/live/karenallenfa/wp-content/plugins/wordfence/vendor/
   wordfence/wf-waf/src/lib/waf.php on line 326 PHP Warning: include(/nas/content/
   live/karenallenfa/wp-content/wflogs/rules.php): failed to open stream: No such
   file or directory in /nas/content/live/karenallenfa/wp-content/plugins/wordfence/
   vendor/wordfence/wf-waf/src/lib/waf.php on line 328 Warning: include(/nas/content/
   live/karenallenfa/wp-content/wflogs/rules.php): failed to open stream: No such
   file or directory in /nas/content/live/karenallenfa/wp-content/plugins/wordfence/
   vendor/wordfence/wf-waf/src/lib/waf.php on line 328 PHP Warning: include(): Failed
   opening ‘/nas/content/live/karenallenfa/wp-content/wflogs/rules.php’ for inclusion(
   include_path=’.:/usr/share/php’) in /nas/content/live/karenallenfa/wp-content/
   plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 328 Warning:
   include(): Failed opening ‘/nas/content/live/karenallenfa/wp-content/wflogs/rules.
   php’ for inclusion (include_path=’.:/usr/share/php’) in /nas/content/live/karenallenfa/
   wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 
   328 PHP Warning: flock() expects parameter 1 to be resource, bool given in /nas/
   content/live/karenallenfa/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/
   src/lib/waf.php on line 329 Warning: flock() expects parameter 1 to be resource,
   bool given in /nas/content/live/karenallenfa/wp-content/plugins/wordfence/vendor/
   wordfence/wf-waf/src/lib/waf.php on line 329 PHP Warning: fclose() expects parameter
   1 to be resource, bool given in /nas/content/live/karenallenfa/wp-content/plugins/
   wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 330 Warning: fclose()
   expects parameter 1 to be resource, bool given in /nas/content/live/karenallenfa/
   wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 
   330
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-errors-with-wp-engine%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Support [WFAdam](https://wordpress.org/support/users/wfadam/)
 * (@wfadam)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/php-errors-with-wp-engine/#post-13322783)
 * Hello [@elleirdad](https://wordpress.org/support/users/elleirdad/) and thanks
   for reaching out!
 * WP Engine doesn’t allow the use of the file-based storage engine for the firewall
   configuration data so you will need to switch to the MySQLi storage engine as
   outlined below:
 * [https://www.wordfence.com/help/firewall/mysqli-storage-engine/](https://www.wordfence.com/help/firewall/mysqli-storage-engine/)
 * More details here:
 * [https://www.wordfence.com/blog/2019/08/wordfence-now-works-on-wp-engine-and-with-load-balancers/](https://www.wordfence.com/blog/2019/08/wordfence-now-works-on-wp-engine-and-with-load-balancers/)
 * Let me know if this helps!
 * Thanks!
 *  Thread Starter [Roger](https://wordpress.org/support/users/elleirdad/)
 * (@elleirdad)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/php-errors-with-wp-engine/#post-13322888)
 * Thank you. Before I edit the PHP, the article [https://www.wordfence.com/help/firewall/mysqli-storage-engine/](https://www.wordfence.com/help/firewall/mysqli-storage-engine/)
   says:
 * “This change is automatic on hosting at WP Engine, since the file-based method
   is not compatible with their configuration.”
 * Therefore, shouldn’t the change happen automatically?
 *  Plugin Support [WFAdam](https://wordpress.org/support/users/wfadam/)
 * (@wfadam)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/php-errors-with-wp-engine/#post-13322977)
 * Hello again [@elleirdad](https://wordpress.org/support/users/elleirdad/)
 * It looks like it hasn’t detected WP Engine. Have you recently migrated or made
   any changes? **“No such file or directory in”** makes it sound like its looking
   for the directory, but this is stored differently on WP Engine.
 * I would make some backups and then check your PHP files in the guide provided,
   just to ensure they are set correctly.
 * Let me know what you find and if this helps!
 * Thanks!
 *  Thread Starter [Roger](https://wordpress.org/support/users/elleirdad/)
 * (@elleirdad)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/php-errors-with-wp-engine/#post-13323252)
 * Yes, it is a recent migration. But, I uninstalled and reinstalled the plugin.
   Is there something else I can do?
 *  Thread Starter [Roger](https://wordpress.org/support/users/elleirdad/)
 * (@elleirdad)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/php-errors-with-wp-engine/#post-13323290)
 * Let me add that I am weak in php knowledge. It is not an easy area for me.
 *  Plugin Support [WFAdam](https://wordpress.org/support/users/wfadam/)
 * (@wfadam)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/php-errors-with-wp-engine/#post-13323967)
 * Hello again [@elleirdad](https://wordpress.org/support/users/elleirdad/)
 * I feel that since you migrated recently to WP Engine, we should reinstall Wordfence.
   I’ll go over the process just to make sure we are doing it correctly.
 * [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 a great reference for this.
 *  It’s always best to make a backup of the site and database before installing/
   removing plugins, just to be safe.
 * Additionally, 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.
 * Let me know if this helps!
 * Thanks!
 *  Thread Starter [Roger](https://wordpress.org/support/users/elleirdad/)
 * (@elleirdad)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/php-errors-with-wp-engine/#post-13324159)
 * Thank you. This seems to have worked.
 *  Plugin Support [WFAdam](https://wordpress.org/support/users/wfadam/)
 * (@wfadam)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/php-errors-with-wp-engine/#post-13324169)
 * Great to hear [@elleirdad](https://wordpress.org/support/users/elleirdad/)
 * Glad you could resolve it!
 * Let us know if you need any other assistance!
 * Thanks again!

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

The topic ‘PHP Errors with WP Engine’ 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

 * [errors](https://wordpress.org/support/topic-tag/errors/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [WP engine](https://wordpress.org/support/topic-tag/wp-engine/)
 * [wpengine](https://wordpress.org/support/topic-tag/wpengine/)

 * 8 replies
 * 2 participants
 * Last reply from: [WFAdam](https://wordpress.org/support/users/wfadam/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/php-errors-with-wp-engine/#post-13324169)
 * Status: resolved