Fixed : Fatal error: Unknown: Failed opening required ‘…./wordfence-waf.php’

Author: | Posted in WordPress No comments

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.

Fix 1

  • 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:

Fix 2

  • 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:
  • Remove that line or add a semicolon before auto_prepend_file