The Wordfence WordPress security plugin provides free enterprise-class WordPress security, protecting WordPress websites from hacks and malware. It is used by thousands of website owners and you may be one of them.
When you change your WordPress website’s hosting or server and your website was using Wordfence Plugin, you may see an error saying “Fatal error: Unknown: Failed opening required ‘/path-to-website/wordfence-waf.php’ (include_path=’.:/usr/lib/php7.0′) in Unknown on line 0”. This fatal error is not very hard to fix.
- Go to root directory of your website and find .user.ini file.
- Download .user.ini file and open it in notepad/notepad++
- Find auto_prepend_file and write a semicolon before it. For example:
INI123; Wordfence WAF;auto_prepend_file = '/path-to-website/wordfence-waf.php'; END Wordfence WAF
- If there is no .user.ini file in root directory, check if there is php.ini file.
- Download php.ini file and open it in Notepad / Notepad++.
- See if there is a line like this:
INI1auto_prepend_file = '/path-to-website/wordfence-waf.php
- Remove that line or add a semicolon before auto_prepend_file