欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory 有大用 有大大用

error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory



机器环境        


       

[vagrant@localhost lib64]$ cat /etc/redhat-release 

CentOS release 6.4 (Final)


       


       

[vagrant@localhost lib64]$ uname -a

Linux localhost.localdomain 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

启动memcache报错        


       

[vagrant@localhost lib64]$ /usr/local/memcached/bin/memcached -d -m 50 -p 11211 -u root -l 0.0.0.0

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


       

查看memcache需要的关联库        


       

[vagrant@localhost lib64]$ ldd /usr/local/memcached/bin/memcached 

linux-vdso.so.1 =>  (0x00007fff50bff000)

libevent-2.0.so.5 => not found        

librt.so.1 => /lib64/librt.so.1 (0x00007f70cc128000)

libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f70cbf0b000)

libc.so.6 => /lib64/libc.so.6 (0x00007f70cbb78000)

/lib64/ld-linux-x86-64.so.2 (0x00007f70cc337000)

解决方案
       

[vagrant@localhost lib64]$ sudo cp /usr/lib/libevent-2.0.so.5 /usr/lib64/


       

来自 https://blog.csdn.net/angel22xu/article/details/44571445        


       


error while loading shared libraries: libevent-2.0.so.5解决办法        

CentOS下如何安装libevent                

1.下载安装包

新版本是libevent-2.0.10-stable。(如果你的系统已经安装了libevent,可以不用安装)
官网:http://www.monkey.org/~provos/libevent/
下载:http://www.monkey.org/~provos/libevent-2.0.10-stable.tar.gz                

2.解压 
# tar zxvf libevent-2.0.10-stable.tar.gz

3.进入目录
# cd libevent-2.0.10-stable

4. 切换到root
# su

5.安装gcc
# yum install gcc

6.设置安装路径
# ./configure –prefix=/usr

7.编译
# make

8.安装
# make install

3.测试libevent是否安装成功:
# ls -al /usr/lib | grep libevent
lrwxrwxrwx 1 root root 21 11?? 12 17:38 libevent-1.2.so.1 -> libevent-1.2.so.1.0.3
-rwxr-xr-x 1 root root 263546 11?? 12 17:38 libevent-1.2.so.1.0.3
-rw-r–r– 1 root root 454156 11?? 12 17:38 libevent.a
-rwxr-xr-x 1 root root 811 11?? 12 17:38 libevent.la
lrwxrwxrwx 1 root root 21 11?? 12 17:38 libevent.so -> libevent-1.2.so.1.0.3
还不错,都安装上了。

http://blog.csdn.net/zhangm168/article/details/6272801                

 

安装memcache时,需要建立文件索引或者说文件连接(link),类似windows下的快捷方式

启动服务时出现 error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory

>whereis libevent-2.0.so.5

libevent-2.0.so.5: /usr/local/lib/libevent-2.0.so.5

> ldd /usr/local/bin/memcached   (ldd指令不熟悉的去查看下)
libevent-2.0.so.5 => not found    (没有找到该文件)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b83fce0e000)
libc.so.6 => /lib64/libc.so.6 (0x00002b83fd029000)
librt.so.1 => /lib64/librt.so.1 (0x00002b83fd381000)
/lib64/ld-linux-x86-64.so.2 (0x00002b83fc9b0000)

> LD_DEBUG=libs ./memcached -v
找到默认路径 /usr/lib/

>sudo ln -s /usr/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5

>sudo ldd /usr/local/bin/memcached
libevent-2.0.so.5 => /usr/lib64/libevent-2.0.so.5 (0x00002b83fcbcd000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b83fce0e000)
libc.so.6 => /lib64/libc.so.6 (0x00002b83fd029000)
librt.so.1 => /lib64/librt.so.1 (0x00002b83fd381000)
/lib64/ld-linux-x86-64.so.2 (0x00002b83fc9b0000)

现在好啦,:)

http://blog.sina.com.cn/s/blog_6d09b5750100vqow.html                


来自 https://www.cnblogs.com/youngt/p/3791216.html        


       

              
       

普通分类: