安装GCC
安装libevent
1
| wget https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz
|
解压文件
1
| tar -zvxf libevent-2.0.22-stable.tar.gz
|
进入目录
1
| cd libevent-2.0.22-stable
|
配置
1
| ./configure --prefix=/usr/local
|
编译
安装
1
| make test && make install
|
安装memcached
1
| wget http://memcached.org/files/memcached-1.4.25.tar.gz
|
解压文件
1
| tar -zvxf memcached-1.4.25.tar.gz
|
进入目录
配置
1
| ./configure --prefix=/usr/local --with-libevent=/usr/local
|
编译
安装
1
| make test && make install
|
安装php memcache扩展
1
| wget http://pecl.php.net/get/memcache-2.2.7.tgz
|
解压
1
| tar -zvxf memcache-2.2.7.tgz
|
进入目录
配置
1 2
| /data/local/php/bin/phpize ./configure --enable-memcache=/usr/local/memcached --with-php-config=/usr/local/php/bin/php-config
|
编译
安装
1
| make test && make install
|
修改php配置
添加一行代码
查看配置
1
| /usr/local/php/bin/php -m | grep memcache
|