memcached安装,安装memcached:error while loading shared libraries: libevent-1.4.so.2

 2023-09-25 阅读 21 评论 0

摘要:安装完memcached,启动时报错如下: /usr/local/memcached/bin/memcached: error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory 首先确认是否已经安装了 libevent,Memcache用到了libevent这个库用于Socket的

安装完memcached,启动时报错如下:

/usr/local/memcached/bin/memcached: error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory

首先确认是否已经安装了 libevent,Memcache用到了libevent这个库用于Socket的处理,所以需要安装libevent,默认是安装在 /usr/local/lib目录下的.

# ls /usr/local/lib/libevent-1.4.so.2
/usr/local/lib/libevent-1.4.so.2

我们要知道memcached去是哪些目录查找libevent动态库的,这里用这个命令

#LD_DEBUG=libs /usr/local/memcached/bin/memcached -v
     29653:      find library=libevent-1.4.so.2 [0]; searching29653:      search cache=/etc/ld.so.cache29653:      search path=/lib64/tls/x86_64:/lib64/tls:/lib64/x86_64:/lib64:/usr/lib64/tls/x86_64:/usr/lib64/tls:/usr/lib64/x86_64:/usr/lib64             (system search path)29653:       trying file=/lib64/tls/x86_64/libevent-1.4.so.229653:       trying file=/lib64/tls/libevent-1.4.so.229653:       trying file=/lib64/x86_64/libevent-1.4.so.229653:       trying file=/lib64/libevent-1.4.so.229653:       trying file=/usr/lib64/tls/x86_64/libevent-1.4.so.229653:       trying file=/usr/lib64/tls/libevent-1.4.so.229653:       trying file=/usr/lib64/x86_64/libevent-1.4.so.229653:       trying file=/usr/lib64/libevent-1.4.so.229653:
/usr/local/memcached/bin/memcached: error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory

先来看一下 LD_DEBUG=libs 这个是什么意思

# LD_DEBUG=help ls
Valid options for the LD_DEBUG environment variable are:libs        display library search pathsreloc       display relocation processingfiles       display progress for input filesymbols     display symbol table processingbindings    display information about symbol bindingversions    display version dependenciesall         all previous options combinedstatistics  display relocation statisticsunused      determined unused DSOshelp        display this help message and exitTo direct the debugging output into a file instead of standard output
a filename can be specified using the LD_DEBUG_OUTPUT environment variable.

memcached安装?我们得知memcached查找动态库的位置是 /lib64 和 /usr/lib64/,所以我们只需把libevent-1.4.so.2 链接到这两个目录就可以了

ln -s /usr/local/lib/libevent-1.4.so.2 /usr/lib64/libevent-1.4.so.2

ok .  


转载于:https://www.cnblogs.com/txwsqk/archive/2011/10/08/2201886.html

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/2/95841.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息