memcache 的安装会报没有编译器所以应该首先安装gcc
gcc的安装方法为 sudo apt-get install build-essential
然后在安装memcache安装之前要先安装libevent
下载地址为
wget http://www.monkey.org/~provos/libevent-2.0.10-stable.tar.gz
下载后使用wget http://www.monkey.org/~provos/libevent-2.0.13-stable.tar.gz
tar xzvf libevent-2.0.13-stable.tar.gz
./configure
make
make install安装Memcached
wget http://memcached.googlecode.com/files/memcached-1.4.7.tar.gz
tar xvzf memcached-1.4.7.tar.gz
cd memcached-1.4.7
./configure --prefix=/usr/local/memcached/
make
make install
方式安装即可。
error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory
在网上查了下
解决这个问题有如下方法:
1>首先 find / -name libevent-2.0.so.5 找到缺少的链接文件到底在那儿。
2> LD_DEBUG=libs /usr/local/memcached/bin/memcached -v
3> 从Debug信息中就知道程序去哪里找链接库了。我这边程序去 trying file=/usr/lib/libevent-2.0.so.5 而我的链接库的实际存储位置是 /usr/local/lib/libevent-2.0.so.5
4>做一个软连接 ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.
5>搞定.