安装memcache
#yum install libevent libevent-devel -y
#tar zxf memcached-1.4.15.tar.gz#./configure --prefix=/usr/local/memcached
#make && make install
php安装memcache模块
#tar zxf memcache-2.2.7.tgz
#/usr/local/php/bin/phpize ./
#./configure --with-php-config=/usr/local/php/bin/php-config --enable-memcache
#make && make install
Libraries have been installed in:
/usr/local/src/memcache-2.2.7/modules
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/
启动memcached
#/usr/local/memcached/bin/memcached -d -m1024 -u www -l 127.0.0.1 -p 11211 -c 10240 -v
# vim /usr/local/php/etc/php.ini
加入memcache模块
[MEMCACHED]
extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/memcache.so
修改如下
;session.save_handler = files
session.save_handler = memcache
;session.save_path = "/tmp"
session.save_path = "tcp://127.0.0.1:11211"