• Resolved bjrnet21

    (@bjrnet21)


    Just installed a “new” WordPress installation at https://www.spacecoasthighlanders.com/ .

    I also have another WordPress installation in the same directory structure under blackjackreview.com.

    On spacecoasthighlanders.com I get Fatal error: Cannot redeclare class wfWAFWordPressRequest in /home/xxxxxx/public_html/blackjackreview.com/wp/wp-content/plugins/wordfence

    So… it looks like it is using the php.ini file at the root level. In php.ini I declare:
    auto_append_file = “/home/xxxxxx/public_html/blackjackreview.com/wp/wordfence-waf.php”

    ..which obviously only refers to the blackjackreview site.

    How do I fix this so the “new” spacecoasthighlanders.com site has Wordfence pointing to the correct wordfence-waf.php file?

    • This topic was modified 6 years, 6 months ago by bjrnet21.

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter bjrnet21

    (@bjrnet21)

    To see what would happen…

    I commented out the following in php.ini:
    ; auto_append_file = “/home/xxxxxxx/public_html/blackjackreview.com/wp/wordfence-waf.php”

    Then, cleared all cache.

    No more errors and both sites appear to be running OK.

    ???

    Did I really need the above auto_append_file entry in php.ini?

    Hi @bjrnet21

    I wonder if any of these sites is installed in a sub-directory of the other one? if so, then please start the firewall optimization process on the site in the sub-directory first, then optimize the firewall on the parent site, that way you shouldn’t have any problem.

    Thanks.

    Thread Starter bjrnet21

    (@bjrnet21)

    Thanks wfalaa for a reply.

    No, both sites are separate. In otherwords,

    ROOT DIRECTORY
    – php.ini
    – blackjackreview.com
    – spacecoasthighlanders.com

    The php.ini file is in the ROOT directory.

    Hi @bjrnet21
    In this case as your websites are on SiteGround, I suggest removing the auto_prepend_file from the main php.ini file, then you will have to check “.htaccess” file on every site you have to make sure each one of them has its own php.ini file -with custom “auto_prepend_file” option loading the correct wordfence-waf.php file for every site- loaded correctly with a similar line like this one:
    SetEnv PHPRC /home/username/public_html/php.ini

    Of course you have to double check the file paths according to your server environment, feel free to get help from SiteGround if there is something you are not sure about.

    Thanks.

    I am having the exact problem described in this thread, so I thought I would chime in. I have two WordPress installations. One is on the parent directory, and one is in a subdirectory. I followed the instructions to optimize first the installation in the subdirectory, but for some reason I am still having problems. The WordPress installation in the subdirectory throws an HTTP Error 500 after optimizing the firewall in the parent directory. I have deleted both Wordfence installations and cleared the cache prior to reinstalling and following the steps anew multiple times, but the result is always the same. I found the following in the error log: PHP Fatal error: Cannot declare class wfWAFWordPressRequest, because the name is already in use in /home3/realtiu2/public_html/social/wp-content/plugins/wordfence/waf/bootstrap.php on line 180.

    I wish I knew what to do with the information in the error log, but I am a “newbie”.

    Disregard…..I just got it to work! Basically, I followed your instructions of removing extended protection on each, then clearing cache, then adding back the protection to the sub-directory install, followed by the parent install. Phew!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Fatal error: Cannot redeclare class wfWAFWordPressRequest …’ is closed to new replies.