Wordfence adding to site causes site to go down
-
Hello,
I had Wordfence previously installed to the site which was not working properly. So i uninstalled them and trying to reinstall the plugin from repository.
The PHP version is 7.4.4 and the site is on latest version of WordPress 5.4.2 and it is on SiteGround hosting.
I had tried all the steps which came to my mind namely:
1) Added WordFence Assistant to remove the WF tables and DB
2) Tried adding the auto_prepend_file in both user.ini and php.ini
results in server error (500) and php log has following error
[25-Jun-2020 17:41:35 CST6CDT] PHP Fatal error: Unknown: Failed opening required ‘/home/hostingname/public_html/domainname/wordfence-waf.php’ (include_path=’.:/usr/local/php74/pear’) in Unknown on line 03) When installing the Wordfence and activating caused error and the whole site goes down.
Need some suggestion of how to go ahead with debugging /steps to activate and configure WordFence.
Thanks
Dipak- This topic was modified 4 years, 5 months ago by dipaksaraf.
The page I need help with: [log in to see the link]
-
Hey @dipaksaraf,
Have you recently migrated the site?
Can you please make sure the code below is present and the paths are correct in your waf.php file found in the root directory?
php_value auto_prepend_file "/path_to_file/wordfence-waf.php"
auto_prepend_file = '/home/username/website.com/wordfence-waf.php'
Please let me know.
Thanks,
Gerroald
Hey Gerroald,
Thanks for looking into the issue!
The site is hosted on siteground and they had migrated the server and this is where the problem has started a month back.
We do have other 2 WordPress installation on the same server which are working smoothly without any issue though the WordPress version is 4.9.14 with PHP version 7.0.0 something!
The installation which I am having problem above is in a subdirectory, which already had Wordfence installed and activated but the live traffic functionality was not working, so I had uninstalled the Wordfence and removed the WF tables. Now whenever I am trying to add Wordfence and try to activate the site is going down.( WordPress version is 5.4.2 and PHP 7.4.4, and I tried to change to PHP version to see if that might be causing an issue?)
Now my present problem here is I am unable to install and activate Wordfence.
Your guidance would be helpful in resolving the issue.
Thanks
DipakHey @dipaksaraf,
Thanks for the update, and information!
Can you please try completely resetting Wordfence manually? This will remove all data and code without you having to do it manually, and likely resolve the issue. If it doesn’t, we can dive deeper.
https://www.wordfence.com/help/advanced/remove-or-reset/#remove-or-reset
Please let me know how it goes.
Thanks,
Gerroald
Hello @wfgerald
I have even tried the manually resetting the plugin when the site goes down by removing WordFence manually and delete the tables which it has created, but this is also not working i guess! any other things which I should try?
Thanks
DipakHey @wfgerald
Just had a chance to look into WP Debug Logs to see what’s going on and this is what I found.
Installing
[26-Jun-2020 20:03:24 UTC] WordPress database error Table 'zhi3fusi_iwsmemb.wp_wfConfig' doesn't exist for query SELECT name, val, autoload FROM wp_wfConfig WHERE name = 'allowLegacy2FA' made by activate_plugin, include_once('/plugins/wordfence/wordfence.php'), require_once('/plugins/wordfence/lib/wordfenceClass.php'), wfCredentialsController::useLegacy2FA, wfCredentialsController::allowLegacy2FA, wfConfig::get [26-Jun-2020 20:03:24 UTC] WordPress database error Table 'zhi3fusi_iwsmemb.wp_wfConfig' doesn't exist for query SELECT name, val, autoload FROM wp_wfConfig WHERE name = 'debugOn' made by activate_plugin, include_once('/plugins/wordfence/wordfence.php'), wordfence::install_actions, wordfence::runInstall, wordfence::status, wordfence::isDebugOn, wfConfig::get [26-Jun-2020 20:03:29 UTC] -------------------------------------- REQUEST: /?_wfsf=detectProxy
Activating the plugin which results in site being dead and an mail with link to recover the access of site
[26-Jun-2020 20:03:30 UTC] PHP Fatal error: Uncaught Error: Call to undefined method wfWAFWordPressRequest::getRawBody() in /home/hostingname/public_html/sitename/wp-content/plugins/wordfence/lib/wordfenceClass.php:1123 Stack trace: #0 /home/hostingname/public_html/sitename/wp-content/plugins/wordfence/lib/wordfenceClass.php(1764): wordfence::initProtection() #1 /home/hostingname/public_html/sitename/wp-includes/class-wp-hook.php(287): wordfence::veryFirstAction('') #2 /home/hostingname/public_html/sitename/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array) #3 /home/hostingname/public_html/sitename/wp-includes/plugin.php(478): WP_Hook->do_action(Array) #4 /home/hostingname/public_html/sitename/wp-settings.php(403): do_action('plugins_loaded') #5 /home/hostingname/public_html/sitename/wp-config.php(105): require_once('/home/hostingname/...') #6 /home/hostingname/public_html/sitename/wp-load.php(37): require_once('/home/hostingname/...') #7 /home/hostingname/public_html/sitename/wp-admin/admin.php(34): require_once('/home in /home/hostingname/public_html/sitename/wp-content/plugins/wordfence/lib/wordfenceClass.php on line 1123
It might give a more details on what’s causing the issue.
Thanks
DipakHello @wfgerald
Any help on the above would be appreciated!
Hey @dipaksaraf,
Thanks for the updates.
Can you send me a Diagnostics report so I can get a better overview of your environment? Please navigate to Wordfence > Tools > Diagnostics. Here you can select
SEND REPORT BY EMAIL
. Please include your www.remarpro.com username and update this thread after you’ve sent it.Once I receive this I’ll take a look and share this with the developers for their thoughts.
Thanks,
Gerroald
Hello @wfgerald
The wordfence eas installed previously, but updating the PHP to 7.4.4 has made site and admin inaccessable. So I had it removed in order to gain access to admin area as well as site.
When I am adding Wordfence again the above error are appearing in wp debug logs and the site and admin area is inaccessible.
So I guess won’t be able to send you the diagnostic report. Any other details which you might need to debug the issue?
Thanks
DipakHey @dipaksaraf,
When you removed Wordfence and its database tables did you also remove the code within the wordfence-waf.php file?
Thanks,
Gerroald
I will have to check. I think I might have not removed the wordfence-waf.php file.
Let me check and then come back to you on this, btw thanks for reply, I appreciate the care Wordfence takes of their users!
Thanks
DipakHey @wfgerald
I can confirm after checking that when I had uninstalled/removed WordFence , there is no wordfence-waf.php file and there is no reference to wordfence-waf.php is user.ini, php.in or .htaccess
However I have been able to install the WordFence successfully and activated it after removing the reference to auto_prepend_file in php.ini and user.ini.
I have sent the Diagnostic report for this installation via Email option as you had suggested.
Now I have added the auto_prepend_file option in php.ini with reference to wordfence.waf.php as suggested manually, but an unable to configure WAF, as it is throwing JS error in admin area as follows:
admin.php?page=WordfenceWAF&subpage=waf_options:863 Uncaught TypeError: $(...).datetimepicker is not a function at HTMLDocument.<anonymous> (admin.php?page=WordfenceWAF&subpage=waf_options:863) at i (load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,utils,jquery-ui-widget,jquery-ui-position,jquery-ui-core,jquery-ui-menu&ver=378622ce9dd7be5a557dc79dcb19c830:2) at Object.fireWith [as resolveWith] (load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,utils,jquery-ui-widget,jquery-ui-position,jquery-ui-core,jquery-ui-menu&ver=378622ce9dd7be5a557dc79dcb19c830:2) at Function.ready (load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,utils,jquery-ui-widget,jquery-ui-position,jquery-ui-core,jquery-ui-menu&ver=378622ce9dd7be5a557dc79dcb19c830:2) at HTMLDocument.J (load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,utils,jquery-ui-widget,jquery-ui-position,jquery-ui-core,jquery-ui-menu&ver=378622ce9dd7be5a557dc79dcb19c830:2) (anonymous) @ admin.php?page=WordfenceWAF&subpage=waf_options:863 i @ load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,utils,jquery-ui-widget,jquery-ui-position,jquery-ui-core,jquery-ui-menu&ver=378622ce9dd7be5a557dc79dcb19c830:2 fireWith @ load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,utils,jquery-ui-widget,jquery-ui-position,jquery-ui-core,jquery-ui-menu&ver=378622ce9dd7be5a557dc79dcb19c830:2 ready @ load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,utils,jquery-ui-widget,jquery-ui-position,jquery-ui-core,jquery-ui-menu&ver=378622ce9dd7be5a557dc79dcb19c830:2 J @ load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,utils,jquery-ui-widget,jquery-ui-position,jquery-ui-core,jquery-ui-menu&ver=378622ce9dd7be5a557dc79dcb19c830:2
Suggest.
Thanks
DipakHey @dipaksaraf,
Thanks for the update.
It seems we’re getting closer here. This error seems like it could be due to a conflict. Are you able to disable all other plugins, switch to a WordPress default theme and try once more?
Please let me know.
Thanks,
Gerroald
Hello @wfgerald
This is a live site so i can able to fiddle around with disabling the plugin and switching to default site in order to debug the error for the time being. My only think which is appearing to not work would be Firewall as per the notification in admin area, but since the firewall is in learning mode it would be enabled and protected in next 7 days as appearing in Firewalls subscreen.
So my only question for the time being would be even if the notification appears in admin area of Wordfence >> https://prnt.sc/t9bub7 (screenshot) is the WAF configured as I had added the auto_prepend_file in php.ini are to reference to wordfence-waf.php in the root of this site. ( I had copied the above file from my other server and edited the path to point to this installation of WAF, WAF log files)
Thanks
DipakHello @wfgerald
Update to my last feedback. I have manage to resolve those notification of the WAF configuration in admin area by adding the auto_prepend_path in user.ini of this WordPress installation.
I would be keeping the site under watch and provide feedback on how it works out!
Thanks for your valuable inputs in configuring and debugging the Wordfence installation.
Appreciate your inputs and response! Cheers
Dipak
Hey @dipaksaraf,
I really believe this error can cause issues and is due to a plugin/theme conflict. The jQuery datetimepicker() function is used for many things within Wordfence, and possibly other areas of your site. Are you able to set up a staging site to test for the conflict?
I believe from what you’ve shared the WAF is configured properly. However, if the datetimepicker() function isn’t working correctly it might affect the scheduling of your Scans, and other things on the site.
Please let me know.
Thanks,
Gerroald
- The topic ‘Wordfence adding to site causes site to go down’ is closed to new replies.