PHP環境でmemache、redis拡張モジュールをインストール

1.phpをコンパイル、インストールオプション
./configure –prefix=/usr/local/php –with-mysql=mysqlnd –with-pdo-mysql=mysqlnd –with-mysqli=mysqlnd –with-iconv –with-openssl –enable-mbstring –with-freetype-dir –with-jpeg-dir –with-png-dir –with-libxml-dir=/usr/ –enable-xml –enable-sockets –enable-fpm –with-config-file-path=/etc/ –with-config-file-scan-dir=/etc/php.d –with-bz2 –with-curl –with-mhash –with-mcrypt –enable-intl –with-gd –enable-gd-native-ttf –enable-shmop
2.libmemcacheをコンパイルしてインストールする
ダウンロードURL:
https://launchpad.net/libmemcached

コンパイルインストール:
wget
tar xf libmemcached-1.0.18.tar.gz
cd libmemcached-1.0.18.tar.gz
./configure
make && make install

3.memcacheをインストール
ダウンロードURL:
http://pecl.php.net/package/memcache
コンパイル
<a href="http://pecl.php.net/get/memcache-3.0.8.tgz" target="_blank">http://pecl.php.net/get/memcache-3.0.8.tgz</a>
tar xf memcache-3.0.8.tgz
cd memcache-3.0.8

4.phpizeの実行
/usr/local/php/bin/phpize
./configure –with-php-config=/usr/local/php/bin/php-config
make && make install

5.php.iniを編集、下記追加
extension=memcache.so

6.redisのダウンロード
http://pecl.php.net/package/redis

PHP

Posted by arkgame