Support » Plugin: Wordfence Security - Firewall & Malware Scan » How Fix wordfence-waf.php error

  • Resolved ambersaleem


    I was previously using wordfence security plugin but later on I deleted. In file manager there was a file name wordfence and I removed it as I thought I don’t have this plugin now. After that my site is down. This is quite frustrating for me. Kindly help to solve the issue.
    I am getting this error in error_log.
    PHP Fatal error: Unknown: Failed opening required ‘/home/channeli/public_html/’ (include_path=’.:/opt/alt/php54/usr/share/pear:/opt/alt/php54/usr/share/php’) in Unknown on line 0

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Just disconnect it in .user.ini, .htaccess, or php.ini, wherever the auto_prepend config was put.

    Should have been done before deleting the file.


    Hi ambersaleem!
    As already mentioned, some code has been left behind in your .htaccess file and/or a .user.ini file which loads the file you deleted via a PHP value called auto_prepend_file. Please check those two files, they will be located in the root of your WordPress installation (where you found and deleted the wordfence-waf.php) file. Remove any code from them that sets auto_prepend_file. Here is an example of what that code can look like

    php_value auto_prepend_file '/home/public_html/wordfence-waf.php'

    Best of luck for now!

    I just upgraded my WF account to Premium. When trying to enable the Firewall I get the message “unable to write to ~/wp-content/wflogs/ which the WAF uses for storage. Please update permissions on the parent directory so the web server can write to it.” Couldn’t find any file named wordfence-waf.php. Am I creating a new one? Confused????

    My web server doesn’t allow writing to wp-content/wflogs. Your fix on says I should add this line:
    define(“WFWAF_LOG_PATH”, ‘/var/www/html/wp-content/wflogs/’);after the opening.

    I’m not sure of the proper syntax for adding this line. I get an internal server error when adding it.

    Where and whats the proper syntax, please
    Here’s my file .htaccess file:

    DirectoryIndex index.php

    # BEGIN WordPress

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress


    Hi juciydesigners!
    The docs you referenced can be used to set a different path to wflogs than the default path. Normally Wordfence tries to store the Firewall configuration files in wp-contet/wflogs but if you want it to use a different directory, you can use the WFWAF_LOG_PATH constant to set that. The directory should be a directory that is writable by the user that WordPress is running as. You do not need to create the directory, but it must be in a location that is writable. Hope that makes sense!

    If you have Wordfence premium you’ll get quicker response if you send in a ticket via

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How Fix wordfence-waf.php error’ is closed to new replies.