下面將介紹安裝php的memcached客戶端安裝步驟
1、下載安裝libmemcached客戶端
官網地址:http://libmemcached.org/libMemcached.html
$wget -c https://launchpad.net/libmemcached/1.0/1.0.16/+download/libmemcached-1.0.16.tar.gz #親 千萬不要下載1.0.17哦 有bug $tar -zxvf libmemcached-1.0.16.tar.gz $cd libmemcached-1.0.16 $./configure --prefix=/usr/local/libmemcached --with-memcached $sudo make $sudo make install
2、下載安裝memcached
官網地址:http://pecl.php.net/package/memcached
$wget -c http://pecl.php.net/get/memcached-2.2.0b1.tgz $tar -zxvf memcached-2.2.0b1.tgz $cd memcached-2.2.0b1 $sudo /usr/local/php/bin/phpize $./configure --enable-memcached --with-php-config=/usr/local/php/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached --disabled-memcached-sasl $sudo make $sudo make install
3、重啟php nginx
$sudo /etc/init.d/nginx restart $sudo /etc/init.d/php restart
注:如何編寫重啟nginx和php腳本 參考
php啟動腳本
nginx啟動腳本
4、檢查是否安裝成功
phpinfo()函數 如果出現如下 則說明安裝成功