Title: Fatal error: Cannot redeclare class wfWAFWordPressRequest &#8230;
Last modified: May 11, 2018

---

# Fatal error: Cannot redeclare class wfWAFWordPressRequest …

 *  Resolved [bjrnet21](https://wordpress.org/support/users/bjrnet21/)
 * (@bjrnet21)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-cannot-redeclare-class-wfwafwordpressrequest/)
 * Just installed a “new” WordPress installation at [https://www.spacecoasthighlanders.com/](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 8 years, 1 month ago by [bjrnet21](https://wordpress.org/support/users/bjrnet21/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffatal-error-cannot-redeclare-class-wfwafwordpressrequest%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Thread Starter [bjrnet21](https://wordpress.org/support/users/bjrnet21/)
 * (@bjrnet21)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-cannot-redeclare-class-wfwafwordpressrequest/#post-10271501)
 * 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?
 *  [wfalaa](https://wordpress.org/support/users/wfalaa/)
 * (@wfalaa)
 * [8 years ago](https://wordpress.org/support/topic/fatal-error-cannot-redeclare-class-wfwafwordpressrequest/#post-10278344)
 * Hi [@bjrnet21](https://wordpress.org/support/users/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](https://www.wordfence.com/help/firewall/optimizing-the-firewall/)
   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](https://wordpress.org/support/users/bjrnet21/)
 * (@bjrnet21)
 * [8 years ago](https://wordpress.org/support/topic/fatal-error-cannot-redeclare-class-wfwafwordpressrequest/#post-10278405)
 * 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.
 *  [wfalaa](https://wordpress.org/support/users/wfalaa/)
 * (@wfalaa)
 * [8 years ago](https://wordpress.org/support/topic/fatal-error-cannot-redeclare-class-wfwafwordpressrequest/#post-10280522)
 * Hi [@bjrnet21](https://wordpress.org/support/users/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.
 *  [realtimecrime](https://wordpress.org/support/users/realtimecrime/)
 * (@realtimecrime)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/fatal-error-cannot-redeclare-class-wfwafwordpressrequest/#post-10472546)
 * 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”.
 *  [realtimecrime](https://wordpress.org/support/users/realtimecrime/)
 * (@realtimecrime)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/fatal-error-cannot-redeclare-class-wfwafwordpressrequest/#post-10472570)
 * 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.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

## Tags

 * [wordfence-waf.php](https://wordpress.org/support/topic-tag/wordfence-waf-php/)

 * 6 replies
 * 3 participants
 * Last reply from: [realtimecrime](https://wordpress.org/support/users/realtimecrime/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/fatal-error-cannot-redeclare-class-wfwafwordpressrequest/#post-10472570)
 * Status: resolved