memcached下载http://memcached.org/
libevent下载http://monkey.org/~provos/libevent/
memcache扩展下载http://pecl.php.net/package/memcache/
分别解压三个文件
1、安装libevent
./configure --prefix=/usr/local/libevent
make
make install
2、安装memcached
./configure --prefix=/usr/local/memcache --with-libevent=/usr/local/libevent
make
make install
3、安装memcache扩展
/usr/local/php/bin/phpize
./configure --enable-memcache --with-php-config=/usr/local/php/bin/php-config --with-zlib-dir
make
make install
在php.ini里面添加
extension=memcache.so
4、启动memcache服务
/usr/local/bin/memcache -d -m 200 -u root
检测是否开启
netstat -anl | grep 11211
重启php-fpm