A-A+

wp搬家后WP Super Cache错误

2013年07月24日 生活随写 评论 8 条 阅读 9,877 次

wordpress搬家后,WP Super Cache提示错误,卸载并全新安装几次都未能解决问题。
在wp后台设置WP Super Cahce中错误提示:

错误: Sample WP-Cache 设置文件
(/.../.../.../.../wp-content/plugins/wp-super-cache/wp-cache-config-sample.php)
不存在。请检查您的安装。
无法继续... 请修复之前遇到的问题然后重试。

于是检查wp-super-cache/advanced-cache.php文件,反馈回来的错误信息是:

  1. echo "<!-- WP Super Cache is installed but broken. The constant WPCACHEHOME must be set in the file wp-config.php and point at the WP Super Cache plugin directory. -->";

好了,似乎有点眉目了,原来问题出现在wp-config.php文件。返回博客根目录打开wp-config.php,

在MySQL设置里,
原来只改了数据库名字,忘了改WP Super Cache的物理路径。

  1. //define('WP_CACHE', true); //Added by WP-Cache Manager
  2. define( 'WPCACHEHOME', '/.../.../public_html/.../wp-content/plugins/wp-super-cache/' ); //Added by WP-Cache Manager

修改后,问题解决。

8 条留言  访客:0 条  博主:0 条

  1. iWin8

    谢谢,处理好了哦!

    • 秋收稻田

      @iWin8: 不客气哈,恭喜你!

  2. zmz

    怎么改啊,不太懂,phpmyadmin能改吗?

    • zmz

      解决了,刚才没看懂!谢谢,你这个是全网唯一解决办法!加油!

  3. andy

    没看懂,可以指导下吗?

  4. andy

    我在wp-config.php添加了这句:define( ‘WPCACHEHOME’, ‘/…/…/public_html/…/wp-content/plugins/wp-super-cache/’ );
    这句define(‘WP_CACHE’, true);注释了,但是没有缓存成功。
    浏览器查看源代码,没有Super Cache的提示

    • Kevin Ling

      你好,这个方法是针对更换服务器后对应的WP文件路径变化才有效的,现在在wp-config.php里面修改的这个代码目的是让它指定现在新服务器路径的wp-super-cache位置。所以这句代码是不能直接复制粘贴的。
      【 define( ‘WPCACHEHOME’, ‘/…/…/public_html/…/wp-content/plugins/wp-super-cache/’ );】

      应该把这段代码里面的”…”改成对应的路径,比如我的是:【/home/wdlybcom/public_html/blog/wp-content/plugins/wp-super-cache/】

给我留言