加载共享库时出错:'libpcre.so.0:无法打开共享对象文件:没有这样的文件或目录'

时间:2011-12-14 08:06:24

标签: nginx ruby-on-rails-3.1 passenger

我刚刚安装了Passenger 3.0.11和nginx并收到了此错误:

  

启动nginx:/ opt / nginx / sbin / nginx:加载共享库时出错:libpcre.so.0:无法打开共享对象文件:没有这样的文件或目录

6 个答案:

答案 0 :(得分:67)

我遇到了同样的错误,我通过运行sudo ldconfig修复了问题。

答案 1 :(得分:6)

执行以下命令并重新启动服务器。

export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

答案 2 :(得分:5)

该消息意味着它所说的内容。编译nginx可执行文件以期望PCRE(Perl兼容的正则表达式)共享库在LD_LIBRARY_PATH上的某个位置可用,或在/etc/ld.so.conf中指定,或者任何等效的库定位机制适用于您的操作系统,以及它无法找到图书馆。

您需要安装PCRE - 或配置您的环境,以便nginx查找安装它的PCRE库。

答案 3 :(得分:0)

很少有建议,因此,我已经解决了我遇到的问题。

  • 如上所述,在/etc/ld.so.conf中添加lib路径,并使用ldconfig -v来检查该路径是否已更新
  • .bash_profile中添加LD_LIBRARY_PATH并用. . bash profile刷新。
  • 如果没有更新lib文件,请使用updatedb刷新库列表。

答案 4 :(得分:0)

只需重新安装h5py conda,为我解决

答案 5 :(得分:0)

为Linux服务器安装ClamAV Antivirus后,我遇到了相同的错误。

[root@10 ~]# yum install clamav clamav-db clamd -y
Loaded plugins: aliases, changelog, kabi, presto, product-id, refresh-packagekit, security, subscription-manager, tmprepo, verify,
              : versionlock
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Loading support for Red Hat kernel ABI
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package clamav.x86_64 0:0.100.3-1.el6 will be installed
--> Processing Dependency: libjson-c.so.2()(64bit) for package: clamav-0.100.3-1.el6.x86_64
---> Package clamav-db.x86_64 0:0.100.3-1.el6 will be installed
---> Package clamd.x86_64 0:0.100.3-1.el6 will be installed
--> Running transaction check
---> Package json-c.x86_64 0:0.11-13.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================
 Package                         Arch                         Version                              Repository                  Size
====================================================================================================================================
Installing:
 clamav                          x86_64                       0.100.3-1.el6                        base                       1.3 M
 clamav-db                       x86_64                       0.100.3-1.el6                        base                       150 M
 clamd                           x86_64                       0.100.3-1.el6                        base                       243 k
Installing for dependencies:
 json-c                          x86_64                       0.11-13.el6                          base                        27 k

Transaction Summary
====================================================================================================================================
Install       4 Package(s)

Total download size: 152 M
Installed size: 154 M
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 152 M
(1/4): clamav-0.100.3-1.el6.x86_64.rpm                                                                       | 1.3 MB     00:00
(2/4): clamav-db-0.100.3-1.el6.x86_64.rpm                                                                    | 150 MB     00:01
(3/4): clamd-0.100.3-1.el6.x86_64.rpm                                                                        | 243 kB     00:00
(4/4): json-c-0.11-13.el6.x86_64.rpm                                                                         |  27 kB     00:00
------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                               100 MB/s | 152 MB     00:01
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : json-c-0.11-13.el6.x86_64                                                                                        1/4
/sbin/ldconfig: libraries libpcre.so.0 and libpcre.so.1 in directory /lib64 have same soname but different type.
  Installing : clamav-db-0.100.3-1.el6.x86_64 [#############################                                                  ] 2/4
  Installing : clamav-db-0.100.3-1.el6.x86_64                                                                                   2/4
  Installing : clamav-0.100.3-1.el6.x86_64                                                                                      3/4
  Installing : clamd-0.100.3-1.el6.x86_64                                                                                       4/4
  Verifying  : clamd-0.100.3-1.el6.x86_64                                                                                       1/4
  Verifying  : clamav-0.100.3-1.el6.x86_64                                                                                      2/4
  Verifying  : json-c-0.11-13.el6.x86_64                                                                                        3/4
  Verifying  : clamav-db-0.100.3-1.el6.x86_64                                                                                   4/4

Installed:
  clamav.x86_64 0:0.100.3-1.el6              clamav-db.x86_64 0:0.100.3-1.el6              clamd.x86_64 0:0.100.3-1.el6

Dependency Installed:
  json-c.x86_64 0:0.11-13.el6

Complete!
[root@10 ~]#
[root@10 ~]# grep: error while loading shared libraries: libpcre.so.0: wrong ELF class: ELFCLASS32
grep: error while loading shared libraries: libpcre.so.0: wrong ELF class: ELFCLASS32

[root@10 ~]# grep: error while loading shared libraries: libpcre.so.0: wrong ELF class: ELFCLASS32

后来我发现以下库已从/ lib64中删除

libjson-c.so.2.0.1
libjson.so.0.1.0
libpcre.so.0 -> libpcre.so.0.0.1

我从其他服务器复制了这些文件并卸载了ClamAV。

Running Transaction
  Erasing    : clamd-0.100.3-1.el6.x86_64                                                                                       1/3
  Erasing    : clamav-0.100.3-1.el6.x86_64                                                                                      2/3
warning: /etc/freshclam.conf saved as /etc/freshclam.conf.rpmsave
  Erasing    : clamav-db-0.100.3-1.el6.x86_64                                                                                   3/3
  Verifying  : clamd-0.100.3-1.el6.x86_64                                                                                       1/3
  Verifying  : clamav-0.100.3-1.el6.x86_64                                                                                      2/3
  Verifying  : clamav-db-0.100.3-1.el6.x86_64                                                                                   3/3

Removed:
  clamav.x86_64 0:0.100.3-1.el6              clamav-db.x86_64 0:0.100.3-1.el6              clamd.x86_64 0:0.100.3-1.el6

Complete!
sending incremental file list
libjson-c.so.2.0.1
libjson.so.0.1.0
libpcre.so.0 -> libpcre.so.0.0.1