Error while loading shared libraries: 'libpcre.so.0: cannot open shared object file: No such file or directory'

后端 未结 6 877
梦如初夏
梦如初夏 2020-12-07 21:08

I just installed Passenger 3.0.11 and nginx and got this error:

Starting nginx: /opt/nginx/sbin/nginx: error while loading shared libraries: libpcre.s

相关标签:
6条回答
  • 2020-12-07 21:44

    I got the same error, and I fixed the problem by running sudo ldconfig.

    0 讨论(0)
  • 2020-12-07 21:47

    just reinstall h5py conda, solved for me

    0 讨论(0)
  • 2020-12-07 21:48

    I got the same error after I installed ClamAV, Antivirus for my Linux server.

    [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
    

    Later I found below libraries got deleted from /lib64

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

    I copied those from other server and uninstalled 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
    
    0 讨论(0)
  • 2020-12-07 21:55

    There are few recommendations, with this I have solved the issue which I had.

    • As mentioned above add the lib path in the /etc/ld.so.conf and check the same is updated or not by using ldconfig -v
    • Add the LD_LIBRARY_PATH in the .bash_profile and refresh the same with . . bash profile.
    • If the lib file is not get updated then use the updatedb to refresh the library list.
    0 讨论(0)
  • 2020-12-07 21:57

    The message means what it says. The nginx executable was compiled to expect the PCRE (Perl-compatible Regular Expression) shared library to be available somewhere on LD_LIBRARY_PATH or specified in /etc/ld.so.conf or whatever equivalent library-locating mechanisms apply to your operating system, and it cannot find the library.

    You will need to install PCRE - or configure your environment so that nginx will look for the PCRE library where it is installed.

    0 讨论(0)
  • 2020-12-07 21:58

    Execute below command and restart server again.

    export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
    
    0 讨论(0)
提交回复
热议问题