简体   繁体   English

致命错误:未知:需要打开失败

[英]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.我在尝试访问我的域http://localhost/home/avis-communes/站点 wordpress 的任何部分时遇到此错误,无论是前端还是后端。 I tried removing the wordfence plugin through ftp and I still get the following error.我尝试通过 ftp 删除 wordfence 插件,但仍然出现以下错误。

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警告:未知:无法打开 stream:第 0 行未知中没有此类文件或目录 致命错误:未知:无法打开所需的 '/home/avis-communes/wordfence-waf.php' (include_path='.;C:\ php\pear') 在第 0 行未知

Any assistance would be appreciated in file .htaccess:文件 .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

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).看起来您可能以某种方式移动或删除了 PHP“ auto_prepend_file ”指令 (/home/avis-communes/wordfence-waf.php) 中指定的文件。

This file is related to the Wordfence Firewall " optimization ".该文件与 Wordfence 防火墙“ 优化”有关。 At this stage, I suggest you remove the optimization and start over.在这个阶段,我建议您删除优化并重新开始。

Open file .htaccess打开文件 .htaccess

close line关闭线

Wordfence WAF文字围栏 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'

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'

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 .如果您使用WordFence 安全插件,则需要验证.user.ini.htaccesswordfence-waf.php In your case, the path needs to be verified is "/home/avis-communes/".在您的情况下,需要验证的路径是“/home/avis-communes/”。

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然后你必须检查wordfence-waf.php然后你可以看到

Domain name with your previous domain you have to correct them域名与您以前的域名,您必须更正它们在此处输入图片说明

Now We have to check the web site if the issue is same we have to config the .htaccess现在我们必须检查网站,如果问题相同,我们必须配置.htaccess

在此处输入图片说明

Then that will be fixed.那么这将被修复。

In my case, I installed Wordfence firewall optimization which added a bunch of configuration to my .htaccess.就我而言,我安装了 Wordfence 防火墙优化,它为我的 .htaccess 添加了一堆配置。 But After deactivating and deleting the plugin, I tried to clear the /var/www/wordpress/wordfence-waf.php file.但是在停用并删除插件后,我尝试清除/var/www/wordpress/wordfence-waf.php文件。

Because the HTACCESS had an auto_prepend_file for this file, my whole site was down.因为 HTACCESS 有这个文件的auto_prepend_file ,我的整个站点都关闭了。

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从 .htaccess 中删除 Wordfence 的配置

Ideally, the plugin should have deleted the config inside the HTACCESS.理想情况下,插件应该删除 HTACCESS 中的配置。 For this, delete everything between the lines # Wordfence WAF and # END Wordfence WAF .为此,字里行间删除一切# Wordfence WAF# END Wordfence WAF

Maybe you didn't install wordpress to yours, so try installing it.也许你没有安装 wordpress 到你的,所以尝试安装它。 Some hosting providers require you to install it separately from their user panel / application panel.一些托管服务提供商要求您将其与他们的用户面板/应用程序面板分开安装。 Thats how we solved our issue.这就是我们解决问题的方式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM