linux 下memcached安装排错

解决Linux: error while loading shared libraries: ...: cannot open shared object file: No such file or directory 类似问题

  5169人阅读  评论(5)  收藏  举报

我遇到  error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory 这样的问题是在安装memcached的时候遇到的。

 

我按别人的攻略安装了libevent和memcached之后却发现在执行的时候出现了。 error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory 这个错误提示。

 

解决类似问题的步骤我相信我的做法可以通用。

 

1. 首先 find / -name libevent-1.4.so.2 找到缺少的链接文件到底在那儿。

2. LD_DEBUG=libs /usr/local/bin/memcached -v

3. 从Debug信息中就知道程序去哪里找链接库了。我这边程序去 trying file=/usr/lib/libevent-1.4.so.2 而我的链接库的实际存储位置是 /usr/local/lib/libevent-1.4.so.2

4. 做一个软连接 ln -s /usr/local/lib/libevent-1.4.so.2 /usr/lib/libevent-1.4.so.2

5. 搞定。

猜你喜欢

转载自mark-ztw.iteye.com/blog/1508591