php重新编译安装memcache

最近在应用memcached的时候,发现有一台服务器,往缓存里写数据的时候失败率超高,甚至100%失败,找了不方原因,最后发现,原来是memcached编译的出的问题,重新编译,并记录下了过程,以便以后查看:)

# 安装libevent

cd /home/lnmp/src
wget http://www.monkey.org/~provos/libevent-1.4.14b-stable.tar.gz
tar zxvf libevent-1.4.14b-stable.tar.gz
cd libevent-1.4.14b-stable
./configure –prefix=/usr/local && make && make install


# 查看是否安装成功

ls -al /usr/local/lib | grep libevent


# 安装memcached

wget http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz
tar zxvf memcached-1.4.5.tar.gz
./configure –with-libevent=/usr/local && make && make install


# 安装PHP扩展

tar xvf memcache-2.2.5.tgz
cd memcache-2.2.5
/usr/local/webserver/php/bin/phpize
./configure \
–enable-memcache \
–with-zlib-dir \
–with-php-config=/usr/local/webserver/php/bin/php-config
make && make install


你可能感兴趣的:(Linux)