解決 WP Super Cache 發生找不到 wp-cache-phase1.php 問題

如果網站進行搬家或是安裝WP Super Cache時,若是主機沒有安裝suPHP功能的話,在權限上比較麻煩,因為會造成 WP Super Cache 出現一堆錯誤。其中一項錯誤應該是:

中文:

警告! WP Super Cache 快取毀損! advanced-cache.php 腳本無法載入 wp-cache-phase1.php。
請編輯 /home/public_html/wp-content/advanced-cache.php 並且確認指向 /home/public_html/wp-content/plugins/wp-super-cache/wp-cache-phase1.php 的路徑是正確的。

原文:

Warning! WP Super Cache caching broken! The script advanced-cache.php could not load wp-cache-phase1.php.
Please edit /home/public_html/wp-content/advanced-cache.php and make sure the path to /home/public_html/wp-content/advanced-cache.php is correct.

網路上有許多解決方式,其中有一種是說可以修改程式:/wp-content/advanced-cache.php ,將 WPCACHEHOME 改成WP Super Cache正確路徑,但其實不必這麼麻煩。我們只要修改網站設定檔案並定義WPCACHEHOME的路徑即可。

解決找不到 wp-cache-phase1.php 的方法

修改檔案:/wp-config.php

在適當位置加入以下語法,其中:/home/public_html/wp-content/ 請換成您主機對於此外掛的絕對路徑。

define( 'WPCACHEHOME', '/home/public_html/wp-content/' );