linux 配置memcached以及php的memcache扩展

1、安装libevent(libevent-2.0.22-stable.tar.gz)​

memcached依赖libevent包

libevent 是一个用C语言编写的、轻量级的开源高性能网络库​

tar zxvf libevent-2.0.22-stable.tar.gz

cd libevent-2.0.22

./configure --prefix=/usr/local/libevent

make​ && make install

2、安装memcached(memcached-1.4.29.tar.gz)

tar zxvf memcached-1.4.29.tar.gz

cd memcached-1.4.29

./configure --prefix=/usr/local/memcached --with-libevent=/usr/local/libevent/

make​ && make install

启动memcached:memcached -d -u root -m 64 -p 11211 -l 10.251.244.32 

表示占用64M内存,端口11211,ip为10.251.244.32

3、安装php的memcache扩展(memcache-2.2.7.tgz)

tar zxvf memcache-2.2.7.tgz

cd memcache-2.2.7

/usr/local/php/bin/phpize​

./configure --enable-memcache --with-php-config=/usr/local/php/bin/php-config

make && make install

安装完显示:Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-zts-20131226/

则修改php配置文件:

vim /usr/local/php/etc/php.ini

添加如下:

​extension = /usr/local/php/lib/php/extensions/no-debug-zts-20131226/memcache.so

重启apache​

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值