淑昊柠 发表于 2015-8-31 10:55:09

启动memcache时遇到 error while loading shared libraries: libevent-1.4.so.2: cannot o

  error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory
我在启动memcache时遇到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. 搞定。
  
  这种情况特别是在软件是32位,而系统是64位的情况下出现,查了一下,软件把文件放到usr/lib下,而系统查找路径是usr/lib64下。
  
  转自:
  http://blog.iyunv.com/orion_04/archive/2009/07/29/4390666.aspx
页: [1]
查看完整版本: 启动memcache时遇到 error while loading shared libraries: libevent-1.4.so.2: cannot o