1、下载libmemcached库 地址在https://code.launchpad.net/libmemcached

wget https://launchpad.net/libmemcached/1.0/1.0.18/+do...

2、下载php memcached扩展,地址在http://pecl.php.net/package/memcached

wget http://pecl.php.net/get/memcached-2.2.0.tgz

或者用pecl下载:

pecl download memcached

3、解压

[root@localhost solf]# tar zxvf libmemcached-1.0.18.tar.gz 

[root@localhost solf]# tar zxvf memcached-2.2.0.tgz

4、安装 libmemcached

[root@localhost libmemcached-1.0.18]# ./configure --prefix=/usr/local/libmemcached --with-memcached

[root@localhost libmemcached-1.0.18]# make && make install

5、安装PHPmemcached扩展

运行phpize命令生成configure配置文件

[root@localhost memcached-2.2.0]# phpize

安装,因为机子上可能没有sasl,这里暂时不启用,加上参数--disable-memcached-sasl,否则--enable-sasl

[root@localhost memcached-2.2.0]# ./configure --enable-memcached --with-libmemcached-dir=/usr/local/libmemcached/ --prefix=/usr/local/phpmemcached --with-memcached --disable-memcached-sasl

make && make install

到些安装完成

6、配置php,加载memcahed扩展

extension=memcached.so

 

每次安装都蛋疼的找不到一个libmemcached的地址。。备注下。。

posted on 2015-07-31 11:21  mynetstudy  阅读(173)  评论(0编辑  收藏  举报