error while loading shared libraries: libevent-2.1.so.6 的解决办法

Posted jaww

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了error while loading shared libraries: libevent-2.1.so.6 的解决办法相关的知识,希望对你有一定的参考价值。

执行 memcached 启动命令时,报错,提示:error while loading shared libraries: libevent-2.1.so.6: cannot open shared object file: No such file or directory

查看 memcached 命令缺失什么库
ldd /usr/local/memcached/bin/memcached

ldd /usr/local/memcached/bin/memcached

 结果: libevent-2.1.so.6 模块找不到

查看 libevent-2.1.so.6 是否存在
locate libevent-2.1.so.6

locate libevent-2.1.so.6

 结果: 系统已经安装了该模块,在路径 /usr/local/lib/

查看 memcached 查找依赖库的路径
LD_DEBUG=libs /usr/local/memcached/bin/memcached -v

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

 结果: 在 /lib64/ 目录中查找,所以找不到已经安装好的

映射 libevent-2.1.so.6 到 /lib64 路径中
ln -s /usr/local/lib/libevent-2.1.so.6 /usr/lib64/libevent-2.1.so.6

ln -s /usr/local/lib/libevent-2.1.so.6 /usr/lib64/libevent-2.1.so.6

结果:这样处理后,memcached就可以搜索到该文件了

启动memcached服务
/etc/init.d/memcached restart

/etc/init.d/memcached restart

此处会略有不同,因为提前已经安装了memcache开机启动脚本

 






以上是关于error while loading shared libraries: libevent-2.1.so.6 的解决办法的主要内容,如果未能解决你的问题,请参考以下文章

error while loading shared libraries错误解决

error while loading shared libraries错误解决

error while loading shared libraries: libmcrypt.so.4

error while loading shared libraries: libaio.so.1

linux下报错:error while loading shared libraries

error while loading shared libraries的解決方法