####################################
#CentOS+memcached #
#Author:楚霏 #
#Date: 2009-5-15 #
#Env: Centos 5.3 x86_64 #
####################################
一、准备工作
环境:Centos 5.3 x86_64
所需软件:
libevent
memcached服务端与客户端
libmemcached
####################################
下载相关软件
cd /usr/local/src
wget http://monkey.org/~provos/libevent-1.4.10-stable.tar.gz
wget http://danga.com/memcached/dist/memcached-1.3.0.tar.gz
wget http://pecl.php.net/get/memcached-0.1.5.tgz
wget http://download.tangent.org/libmemcached-0.28.tar.gz
####################################
二、安装
(1)安装memcached的服务端支持库
cd /usr/local/src
tar xvf libevent-1.4.10-stable.tar.gz
cd libevent-1.4.10-stable
./configure --help
./configure
make
make install
(2)安装memcached服务器端
cd /usr/local/src
tar xvf memcached-1.3.0.tar.gz
./configure
make
make install
ln -s /usr/local/lib/libevent-1.4.so.2 /lib/libevent-1.4.so.2
(3)安装libmemcached
cd /usr/local/src
tar xvf libmemcached-0.28.tar.gz
cd libmemcached-0.28
./configure
make
make install
(4)让php支持memcached
cd /usr/local/src
tar xvf memcached-0.1.5.tgz
cd memcached-0.1.5
/usr/local/php-fcgi/bin/phpize
./configure --help
./configure --enable-memcache --with-php-config=/usr/local/php-fcgi/bin/php-config
make
make test
make install
cp /usr/local/php-fcgi/lib/php/extensions/no-debug-non-zts-200*/memcached.so /usr/local/php-fcgi/ext/
echo "extension=memcached.so" >> /usr/local/php-fcgi/etc/php.ini
#测试一下是否已加载上
/usr/local/php-fcgi/bin/php-cgi -m |grep mem
(5)启动
#启动memcached
#看一下启动参数
memcached --help
memcached -d -u root -m 1000 -l 127.0.0.1 -p 11211 -P /tmp/memcached.pid
#重启一下web服务器
service nginx restart
CentOS+memcached
Posted by – 2009-05-15
Hi, interest post. I’ll write you later about few questions!