安装 memcached 服务端
yum -y install libevent libevent-devel
#需要 libevent 支持
cd /opt
rm -rf memcached-1.2.0.tar.gz
wget http://192.168.0.97/download/linux/cache/memcached-1.2.0.tar.gz
rm -rf memcached-1.2.0
tar -zxf memcached-1.2.0.tar.gz
cd /opt/memcached-1.2.0
./configure –with-libevent=
make
make install
2、安装 memcache 客户端
cd /opt
rm -rf memcache-2.2.5.tgz
wget http://192.168.0.97/download/linux/cache/memcache-2.2.5.tgz
rm -rf memcache-2.2.5
tar -zxf memcache-2.2.5.tgz
cd /opt/memcache-2.2.5
/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
vi /etc/init.d/memcache_stop.sh
ikill `cat /tmp/memcached.pid`
chmod a+x /etc/init.d/memcache_start.sh
查看memcache状态
telnet 192.168.0.98 11211
输入stats查询状态
stats
STAT pid 8601
STAT uptime 696
STAT time 1245832689
STAT version 1.2.0
STAT pointer_size 64
STAT rusage_user 0.007998
STAT rusage_system 0.030995
STAT curr_items 1
STAT total_items 1
STAT bytes 76
STAT curr_connections 2
STAT total_connections 4
STAT connection_structures 3
STAT cmd_get 1
STAT cmd_set 1
STAT get_hits 1
STAT get_misses 0
STAT bytes_read 97
STAT bytes_written 620
STAT limit_maxbytes 134217728
END