memcache在php中编译
# wget http://www.lishiming.net/data/attachment/forum/memcache-2.2.3.tgz
# tar zxvf memcache-2.2.3.tgz
# cd memcache-2.2.3
# /usr/local/php/bin/phpize
# ./configure --with-php-config=/usr/local/php/bin/php-config
# make
# make install
# cp modules/memcache.so /usr/local/php/ext/ //把memcache.so 拷贝至php的extension_dir下,#查看php extension_dir的方法是 /usr/local/php/bin/php -i |grep extension_dir
修改扩展路径,在php.ini中修改:
extension_dir = "/usr/local/php/ext"
然后在php.ini 中添加
extension = memcache.so
保存后可以利用 /usr/local/php/bin/php -m 检测和查看具体的参数
memcached 的编译安装
wget http://syslab.comsenz.com/downloads/linux/memcached-1.4.5.tar.gz
tar zxvf memcached-1.2.8.tar.gz
cd memcached-1.2.8
./configure --prefix=/usr/local/memcached
make && make install
启动:
/usr/local/memcached/bin/memcached -m 2048 -p 11211 -l 127.0.0.1 -d -u www
-m 后边指定memecached使用多少内存,单位是M
-p 指定memcached 启动端口
-l 指定绑定的IP
-u 指定以某个账户的身份启动
原文地址:http://blog.51cto.com/amazing61/2063882