缺少动态链接库错误修复
安装memcached时候遇到缺少动态链接库错误:
1
|
[root@test02 bin]
# ./memcached -h
|
1
2
|
./memcached: error while loading shared libraries: libevent-2.0.so.5: cannot open shared
object file: No such file or directory
|
总结下来主要有3种方法:
1. 用ln将需要的so文件链接到/usr/lib或者/lib这两个默认的目录下边
1
2
|
ln
-s
/where/you/install/lib/
*.so
/usr/lib
sudo
ldconfig
|
2.修改LD_LIBRARY_PATH
1
2
|
export
LD_LIBRARY_PATH=
/where/you/install/lib
:$LD_LIBRARY_PATH
sudo
ldconfig
|
3.修改/etc/ld.so.conf,然后刷新
1
2
3
|
vim
/etc/ld
.so.conf
add
/where/you/install/lib
sudo
ldconfig
|
本文转自UltraSQL51CTO博客,原文链接:http://blog.51cto.com/ultrasql/1632967
,如需转载请自行联系原作者