.htaccess » ❌ PHP Fatal error: Unknown: Failed opening required wordfence-waf.php

❌ PHP Fatal error: Unknown: Failed opening required wordfence-waf.php

After migrating a WordPress website ot another cPanel account, the website displayed 500 error, and the following was recorded inside the error_log file:

[17-Aug-2022 12:46:18 Europe/Belgrade] PHP Fatal error: Unknown: Failed opening required ‘/home/XXXXX/XXXXX.com/wordfence-waf.php’ (include_path=’.:/opt/alt/php74/usr/share/pear’) in Unknown on line 0

image 11 1024x252 - ❌ PHP Fatal error:  Unknown: Failed opening required wordfence-waf.php

WordFence adds rules to .htaccess file to include the wordfence-waf.php file by full path:

php_value auto_prepend_file ‘/home/XXXXXX/wpxss.com/wordfence-waf.php’

This file is related to the Wordfence Firewall “optimization” option.

So after changing the cPanel username or migrating to another account it is needed to change the username and path to the wordfence-waf.php file

Edit the .htaccess file and change the path:

image 12 - ❌ PHP Fatal error:  Unknown: Failed opening required wordfence-waf.php

Save the file and visit your website again.

See also  How to fix curl error 60: SSL certificate problem: certificate has expired error ✅

Was this post helpful?

Leave a Comment

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.

Recommended