memcache安装及php的memcache支持
1. 安装memcache
yum install memcached -y
2. 配置自启动
chkconfig memcached on
3. 配置php支持
yum install libmemcached -y wget -c http://pecl.php.net/get/memcache-3.0.8.tgz tar -zxvf memcache-3.0.8.tgz cd memcache-3.0.8 # 确认php是否安装在如下位置 /usr/local/php/bin/phpize ./configure --with-php-config=/usr/local/php/bin/php-config --enable-memcache --with-zlib-dir make make install #打开php.ini vim /usr/local/php/etc/php.ini #最后添加如下内容(extension为make install之后生成的so文件路径) extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/memcache.so session.save_handler = memcache session.save_path = "tcp://127.0.0.100:11211"
最后记得启动memcached,并重启下webserver