• Resolved al1990

    (@al1990)


    I had Wordfence on a site that I moved to a new host. After having trouble with using backupbuddy with Wordfence I deleted the plugin and manually move the site files over after getting the database moved.

    I keep getting Fatal error: Unknown: Failed opening required ‘/public_html/wordfence-waf.php’. This file is no there.

    All of the advice I have seen says to take code out of the .htaccess files (no wf code there) and looked for the php.ini and user.ini files, neither of which are in the root directory, or plugin directories.

    I have also run the Wordfence Assistance plugin. In some browser device combination (Chrome on MAC) I can get the page to load consistently, other (Firefox on MAC, or Chrom on Android) I consistently get the error, so it does not appear to be a caching issue.

    Please help, thanks,

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @al1990,

    Some code has definitely been left behind, which you will need to manually remove.

    In order to locate the php.ini file used in your environment:

    • Go to the Wordfence Tools page
    • Click the Diagnostics tab
    • In the Other Tests section, click the link that reads “Click to view your system’s configuration in a new window”
    • Check the Loaded Configuration File parameter

    In the php.ini you can also check the “user_ini.filename” directive.

    Well, the call for wordfence-waf.php is obviously there, since it bombs the site, and it only has those three options to be called (.htaccess, php.ini, OR a ‘user ini file’ ), sooo..

    If you are running FCGI/PHP-FRM, it will be in the .user.ini file (notice the DOT in front).

    Of course, the ‘.user.ini’ is merely the default name, since the actual name for your local “user ini file” is a configurable option in PHP, that could have been changed by your hosting company. But they rarely do. Causes confusion.

    Checking phpinfo (from command line or from any plugin with a “Diagnostics” page showing PhpInfo) will confirm if your hosting have strayed. (Since you no longer have a WordFence Diags page 🙂 )
    Like

    [~]$ php --info | grep user.ini
    
      user_ini.filename => .user.ini => .user.ini

    WordFence will have used whatever name is configured in PHP for that file. It is not a hard-coded name. But usually installations do not stray from the default name of ‘.user.ini’.

    If you are not running FastCGI/PHP-FPM, then a .user.ini file has no impact (is not used by PHP), and one of the other two options (.htaccess or php.ini) must have been used.

    The “auto_prepend” call should be there in your files.. Somewhere. 🙂

    Do the following steps:

    Run Importbuddy
    When the files have been extracted, look into those and rename .user.ini. Alternatively, you can open the file and delete the wordfence code there.

    You should be able to restore after that

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘wordfence-waf.php Standard fixes don’t work’ is closed to new replies.