Joho the BlogHow to fix the WordFence wordfence-waf.php problem - Joho the Blog

How to fix the WordFence wordfence-waf.php problem

My site has been down while I’ve tried to figure out (i.e., google someone else’s solution) to a crash caused by WordFence, an excellent utility that, ironically, protects your WordPress blog from various maladies.

The problem is severe: Users of your blog see naught but an error message of this form:

Fatal error: Unknown: Failed opening required ‘/home/dezi3014/public_html/wordfence-waf.php’ (include_path=’…/usr/lib/php /usr/local/lib/php’) in Unknown on line 0

The exact path will vary, but the meaning is the same. It is looking for a file that doesn’t exist. You’ll see the same message when you try to open your WordPress site as administrator. You’ll see it even when you manually uninstall WordPress by logging into your host and deleting the wordfence folder from the wp-content/plugins folder

If you look inside the wordfence-waf.php file (which is in whatever folder you’ve installed WordPress into), it warns you that “Before removing this file, please verify the PHP ini setting `auto_prepend_file` does not point to this.”

Helpful, except my php.ini file doesn’t have any reference to this. (I use as my host.) Some easy googling disclosed that the command to look for the file may not be in php.ini, but may be in .htaccess or .user.ini instead. And now you have to find those files.

At least for me, the .user.ini file is in the main folder into which you’ve installed WordPress. In fact, the only line in that file was the one that has the “auto_prepend_file” command. Remove that line and you have your site back.

I assume all of this is too obvious to write about for technically competent people. This post is for the rest of us.

4 Responses to “How to fix the WordFence wordfence-waf.php problem”

  1. At a (wild) guess, you could try creating a php.ini file containing the required instruction and then save it to the root folder for WordPress.

    I’ll be honest, I’m not an Apache expert, but I do know that the php.ini file has various manifestations.

  2. Buna Alexandru,Din contra, unii dintre cei mai mari bucatari ai lumii sunt barbati. Iti multumesc ca ai incercat reteta si desi cu intarziere iti urez La Multi Ani cu multa sanatate si bucurii!!Numai bine iti doresc!!VA:F [1pas21_1169].le9.e wait…VA:F [1.9.21_1169](from 0 votes)

  3. You have no idea how this helped me today. I copied a WordPress site that had Wordfence installed over to another server to back it up and holy hell broke loose. I got rid of the .htaccess file and all is right with the world. You saved me a lot of time, thank you!

  4. I’m so glad it helped. And hanks for letting me know.

Web Joho only

Comments (RSS).  RSS icon