Katty
Katty

Reputation: 87

Fatal error: Unknown: Failed opening required

I get this error when trying to access any part of my domain http://localhost/home/avis-communes/ site wordpress, front or back-end. I tried removing the wordfence plugin through ftp and I still get the following error.

Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0 Fatal error: Unknown: Failed opening required '/home/avis-communes/wordfence-waf.php' (include_path='.;C:\php\pear') in Unknown on line 0

Any assistance would be appreciated in file .htaccess :

    # BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

# Wordfence WAF
<IfModule mod_php5.c>
    php_value auto_prepend_file '/home/avis-communes/wordfence-waf.php'
</IfModule>
<Files ".user.ini">
<IfModule mod_authz_core.c>
    Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
    Order deny,allow
    Deny from all
</IfModule>
</Files>

# END Wordfence WAF

Upvotes: 4

Views: 20610

Answers (6)

Muhammed Aydogan
Muhammed Aydogan

Reputation: 660

Maybe you didn't install wordpress to yours, so try installing it. Some hosting providers require you to install it separately from their user panel / application panel. Thats how we solved our issue.

Upvotes: 0

Raja Anbazhagan
Raja Anbazhagan

Reputation: 4564

In my case, I installed Wordfence firewall optimization which added a bunch of configuration to my .htaccess. But After deactivating and deleting the plugin, I tried to clear the /var/www/wordpress/wordfence-waf.php file.

Because the HTACCESS had an auto_prepend_file for this file, my whole site was down.

There are two ways I was able to solve this.

  1. Create an empty file with the same name
touch /var/www/wordpress/wordfence-waf.php
  1. remove the config from .htaccess for Wordfence

Ideally, the plugin should have deleted the config inside the HTACCESS. For this, delete everything between the lines # Wordfence WAF and # END Wordfence WAF.

Upvotes: 0

Thilina Dharmasena
Thilina Dharmasena

Reputation: 2341

Fatal error: Unknown: Failed opening required '/home/customer/www/domain.com/public_html/wordfence-waf.php' (include_path='.:/usr/local/php73/pear') in Unknown on line 0

Then you have to check the wordfence-waf.php then you can see the

Domain name with your previous domain you have to correct them enter image description here

Now We have to check the web site if the issue is same we have to config the .htaccess

enter image description here

Then that will be fixed.

Upvotes: 0

Tayyab Chaudhary
Tayyab Chaudhary

Reputation: 508

There are different scenarios. If you are using the WordFence Security plugin, you need to verify the paths in .user.ini, .htaccess, and wordfence-waf.php. In your case, the path needs to be verified is "/home/avis-communes/".

Upvotes: 5

Bang Andre
Bang Andre

Reputation: 537

Open file .htaccess

close line

Wordfence WAF

php_value auto_prepend_file '/srv/www/website.com/public_html/wordfence-waf.php'

php_value auto_prepend_file '/srv/www/website.com/public_html/wordfence-waf.php'

Upvotes: 2

yaningo
yaningo

Reputation: 523

It looks like you might somehow have moved or deleted the file specified in the PHP "auto_prepend_file" directive (/home/avis-communes/wordfence-waf.php).

This file is related to the Wordfence Firewall "optimization". At this stage, I suggest you remove the optimization and start over.

Upvotes: 4

Related Questions