WordPress - PHP警告无法打开流:没有这样的文件或目录(advanced-cache.php)

elk*_*kah 7 php wordpress warnings caching

我在后端和前端页面(WordPress)上收到此PHP警告,但无法弄清楚如何修复它:

警告:include(/ home /.../ public_html/wp-content/advanced-cache.php):无法打开流:/home/.../public_html/wp-settings.php中没有此类文件或目录第84行

警告:include():无法打开'/home/.../public_html/wp-content/advanced-cache.php'(include_path ='.:/ usr/lib/php:/ usr/local/lib /第84行的/home/.../public_html/wp-settings.php中的php')

实际上,该目录中没有advanced-cache.php(不确定是否曾经存在),但绝对相同的配置在没有警告的情况下在不同的服务器上运行.

将不胜感激任何帮助.谢谢.

Roh*_*mar 15

我想你已经安装了Advance cache plugin,还有一个设置WP_CACHE

define('WP_CACHE', true);
// or may be it is a file like, if so then comment this line,
// below is the statement which need to be commented
// define('WP_CACHE', is_file(__DIR__.'/wp-content/advanced-cache.php'));
Run Code Online (Sandbox Code Playgroud)

为防止出现此错误,您可以将其设置为false

define('WP_CACHE', false);
Run Code Online (Sandbox Code Playgroud)


小智 5

../wp-content/advanced-cache.php是在安装任何缓存插件时动态生成的,尤其是wordpress.org的缓存插件使用了该插件。因此,您将无法在全新WP安装中找到该文件。

请参考链接

就您而言,我假设您已经安装了一些缓存插件,并且由于任何原因从文件夹中删除了advanced-cache.php文件,或者可能存在执行文件的权限问题。这就是为什么当您的缓存插件尝试搜索并包含advanced-cache.php文件时,它无法找到或执行该文件并引发您提到的错误的原因。

有关其他可能性和建议,我需要知道您使用了哪个缓存插件。如果您想让我进一步帮助,请告诉我...