linux安装memcache php5.4

参考其他网友,安装测试可用:

1.安装libevent

[root@iZ2ze3nu0s9j3yqfu9qsh5Z ~] wget http://www.monkey.org/~provos/libevent-2.0.12-stable.tar.gz

[root@iZ2ze3nu0s9j3yqfu9qsh5Z ~] tar zxf libevent-2.0.12-stable.tar.gz

[root@iZ2ze3nu0s9j3yqfu9qsh5Z ~] cd libevent-2.0.12-stable

[root@iZ2ze3nu0s9j3yqfu9qsh5Z ~]./configure  --prefix=/usr/local/lib

[root@iZ2ze3nu0s9j3yqfu9qsh5Z ~] make && make install

2.安装Memcached

[root@iZ2ze3nu0s9j3yqfu9qsh5Z ~] wget http://memcached.org/files/memcached-1.5.0.tar.gz

[root@iZ2ze3nu0s9j3yqfu9qsh5Z ~] tar zxf memcached-1.5.0.tar.gz

[root@iZ2ze3nu0s9j3yqfu9qsh5Z ~] cd memcached-1.5.0

[root@iZ2ze3nu0s9j3yqfu9qsh5Z ~]./configure --prefix=/usr/local/memcached --with-libevent=/usr/local/lib

[root@iZ2ze3nu0s9j3yqfu9qsh5Z ~] make && make install

3.启用memcached

[root@iZ2ze3nu0s9j3yqfu9qsh5Z ~] /usr/local/memcached/bin/memcached -u root -d

4.安装php-memcache扩展

[root@iZ2ze3nu0s9j3yqfu9qsh5Z ~] wget http://pecl.php.net/get/memcache-3.0.6.tgz

[root@iZ2ze3nu0s9j3yqfu9qsh5Z ~] tar zxvf memcache-3.0.6.tgz

[root@iZ2ze3nu0s9j3yqfu9qsh5Z ~] cd memcache-3.0.6

[root@iZ2ze3nu0s9j3yqfu9qsh5Z ~]/www/server/php/54/bin/phpize  #php对应的编译

[root@iZ2ze3nu0s9j3yqfu9qsh5Z ~]./configure --enable-memcache --with-php-config=/www/server/php/54/bin/php-config --with-zlib-dir

[root@iZ2ze3nu0s9j3yqfu9qsh5Z ~]make && make install

5.在php.ini中添加

extension=memcache.so

6.重启php 

你可能感兴趣的:(linux安装memcache php5.4)