WordPressでMemcachedを使う方法

提供: Wikiducca
2011年10月14日 (金) 02:23時点におけるYosuke (ノート | 投稿記録)による版

移動: 案内検索

livevent のインストール

インストール済みであれば省略。

# yum install libevent

memcached のインストール

インストール済みであれば省略。

# yum install memcached
# service memcached start
# chkconfig memcached on

php 用 memcache クライアントのインストール

# wget http://pecl.php.net/get/memcache-2.2.5.tgz
# tar xzf memcache-2.2.5.tgz
# cd memcache-2.2.5
# phpize
# ./configure
# make
# paco -D make install
(※ paco -D は、不要な人は不要。詳細はこちら 。)

php.ini 編集

/etc/php.ini に、 extension=”memcache.so” を追記。

Apache を再起動

phpinfo で Memcache 関係が追加されたことを確認する。

object-cache.php のインストール

以下から適当に保存して、wp-content/ 配下に移動する。

http://plugins.trac.wordpress.org/browser/memcached/trunk/

wp-config.php 修正

wp-config.php に define(’ENABLE_CACHE’,true); を追記。

動作確認

memcache-top をインストールして、Hit率なんかを確認。

http://code.google.com/p/memcache-top/


以上。