首先要yum需要的开发包
yum install libevent-devel
1、安装memcached
http://memcached.org/
http://www.memcached.org/files/memcached-1.5.3.tar.gz
./configure –prefix=/usr/local/memcached –with-libevent=/usr/lib/
make
make install
2、编译php的memcache模块
http://pecl.php.net/package/memcache
http://pecl.php.net/get/memcache-2.2.7.tgz
/www/wdlinux/php/bin/phpize
./configure –with-php-config=/www/wdlinux/php/bin/php-config
make
make install
3、设置php配置文件加载memcache模块
/www/wdlinux/php/etc/php.ini
extension_dir = “/www/wdlinux/php/lib/php/extensions/no-debug-non-zts-20090626/”
extension=memcache.so
4、启动memcached服务
/usr/local/memcached/bin/memcached -d -m 1024 -p 11211 -u root
可能会遇到的问题:
checking build system type… Invalid configuration `: machine ` not recognized
解决办法是:
先安装好memcached后,再编译php的memcahe模块