• Resolved Roger

    (@elleirdad)


    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 to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support WFAdam

    (@wfadam)

    Hello @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/

    More details here:

    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

    (@elleirdad)

    Thank you. Before I edit the PHP, the article 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

    (@wfadam)

    Hello again @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

    (@elleirdad)

    Yes, it is a recent migration. But, I uninstalled and reinstalled the plugin. Is there something else I can do?

    Thread Starter Roger

    (@elleirdad)

    Let me add that I am weak in php knowledge. It is not an easy area for me.

    Plugin Support WFAdam

    (@wfadam)

    Hello again @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 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/ 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

    (@elleirdad)

    Thank you. This seems to have worked.

    Plugin Support WFAdam

    (@wfadam)

    Great to hear @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.