3.安装memcached
预安装:#./configure --prefix=/usr/local/memcached --with-libevent=/usr
注意:在没有安装libevent的情况下,会报错( If it's already installed, specify its path using --with-libevent=/dir/);
编译并且安装:# make && make install
OK安装成功.
2.安装 BerkeleyDB
下载地址:http://www.oracle.com/technetwork/products/berkeleydb/downloads/index.html
解压包:# tar -zxvf db-5.3.15.tar.gz (根据自身的情况解压到目录)
进入目录:# cd db-5.3.15
# cd build_unix
#../dist/configure --prefix=/usr/local/BerkeleyDB.5.3
# make && make install
#vi /etc/ld.so.conf
增加:
/usr/local/lib
/usr/local/BerkeleyDB.5.3/lib
#vi /etc/profile
增加
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/usr/local/BerkeleyDB.5.3/lib
3.安装memcacheq (注: 下文中的5.3是berkeleyDB的版本 请根据实际情况操作)
预安装:./configure --prefix=/usr/local/memcacheq --enable-threads
注意:在没有安装BerkeleyDB的情况下,会报错( configure: error: cannot find libdb.so in /usr/local/BerkeleyDB.5.3/lib);
# make && make install
测试:/usr/local/memcacheq/bin/memcachq -h
运行报:
memcacheq: error while loading shared libraries: libdb-5.3.so: cannot open shared object file: No such file or directory
解决方法:ln -s /usr/local/BerkeleyDB.5.3/lib/libdb-5.3.so /usr/lib/libdb-5.3.so