libevent-2.0.20-stable.tar.gz (http://monkey.org/~provos/libevent/)

memcache-2.2.3.tgz (http://pecl.php.net/package/memcache)

memcached-1.4.15.tar.gz (http://www.danga.com/memcached/)

wget https://github.com/downloads/libevent/libevent/libevent-2.0.20-stable.tar.gz
tar zxvf libevent-2.0.20-stable.tar.gz
cd libevent-2.0.20-stable
./configure --prefix=/usr
make && make install
ls -al /usr/lib | grep libevent
cd ..
wget http://memcached.googlecode.com/files/memcached-1.4.15.tar.gz
tar zxvf memcached-1.4.15.tar.gz
cd memcached-1.4.15
./configure --with-libevent=/usr
make && make install

/usr/local/bin/memcached -d -m 128 -u root -l 127.0.0.1 -p 11211 -c 128 -P /tmp/memcached.pid

-d选项是启动一个守护进程,
-m是分配给Memcache使用的内存数量,单位是MB,我这里是128MB,按照你服务器的可提供内存数来设定,
-u是运行Memcache的用户,我这里是root,
-l是监听的服务器IP地址,如果有多个地址的话,我这里指定了服务器的IP地址127.0.0.1,
-p是设置Memcache监听的端口,我这里设置了11211,最好是1024以上的端口,
-c选项是最大运行的并发连接数,默认是1024,我这里设置了128,按照你服务器的负载量来设定,
-P是设置保存Memcache的pid文件,我这里是保存在 /tmp/memcached.pid