開発したアプリなど一覧

WP Super Cache is installed but broken.

アフィリエイトリンクを含む場合があります

WordPress のテーマファイルを編集しているときに、 WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! という記述がソースの一番下にあるのに気づいた。

このファイルをみてみると以下のようになっていた。

<?php # WP SUPER CACHE 0.8.9.1 function wpcache_broken_message() { if ( false == strpos( $_SERVER[ 'REQUEST_URI' ], 'wp-admin' ) ) echo "<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->"; }

if ( !include_once( '/path/to/wp/wp-content/plugins/wp-super-cache/' . 'wp-cache-phase1.php' ) ) { if ( !@is_file( '/path/to/wp/wp-content/plugins/wp-super-cache/' . 'wp-cache-phase1.php' ) ) register_shutdown_function( 'wpcache_broken_message' ); } ?>

どうやら WP Super Cache をインストールした際に、このスクリプト内に絶対パスでファイルを指定するのだけど、サーバ移転したときにパスが変わったので上記のエラーが表示されたようだ。

なのでこれを今の環境に合うように修正したらエラーは出なくなった。しかしなぜ絶対パスを直書きしてるんだろう・・・

Sponsored Link

コメント

タイトルとURLをコピーしました