WP Super Cache を使っている WordPress をサーバー移転した時にする事

WordPress で WP Super Cache を使っている場合、サーバー移転をすると /wp-content/advanced-cache.php を書き換えなければいけません。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?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( '[サーバーのパス]/wp-content/plugins/wp-super-cache/' . 'wp-cache-phase1.php' ) ) {
	if ( !@is_file( '[サーバーのパス]/wp-content/plugins/wp-super-cache/' . 'wp-cache-phase1.php' ) ) {
		define( 'ADVANCEDCACHEPROBLEM', 1 );
		register_shutdown_function( 'wpcache_broken_message' );
	}
}
?>

8行目と9行目にサーバーのパスが直接書いてあるので書き換えます。

コメント

  1. だいはくりきさんのコメント

    はじめまして。だいはくりきと申します。

    先日引っ越したWordPressがあるのですが、「WP Super Cache」設定変更が必要なんですね。普通に動いて痛んで未チェックでした。

    これから確認してみます。

    情報ありがとうございました。