如何重启apache,但未找到libpcre.so.1

时间:2017-04-19 01:09:12

标签: apache centos

在Centos 6.8上,我们尝试重新启动httpd并收到错误,找不到libpcre.so.1。

/usr/local/apache-2.4.16/bin/httpd -k stop

ldd ./httpd 
        linux-vdso.so.1 =>  (0x00007fff465ff000)
       **libpcre.so.1 => not found**
       libaprutil-1.so.0 => /usr/local/apache-2.4.16/lib/libaprutil-1.so.0 (0x00007f5cf17d3000)
       libexpat.so.0 => /usr/local/apache-2.4.16/lib/libexpat.so.0 (0x00007f5cf15ac000)
       libapr-1.so.0 => /usr/local/apache-2.4.16/lib/libapr-1.so.0 (0x00007f5cf1379000)
       librt.so.1 => /lib64/librt.so.1 (0x0000003351400000)
       libcrypt.so.1 => /lib64/libcrypt.so.1 (0x0000003353000000)
       libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003351000000)
       libc.so.6 => /lib64/libc.so.6 (0x0000003350c00000)
       /lib64/ld-linux-x86-64.so.2 (0x0000003350400000)
       libfreebl3.so => /lib64/libfreebl3.so (0x0000003353400000)
       libdl.so.2 => /lib64/libdl.so.2 (0x0000003350800000)

不确定发生了什么变化。

有任何修复建议吗?

3 个答案:

答案 0 :(得分:1)

在我看来,只有libpcre.so.3可用。因此,创建从libpcre.so.3到libprce.so.1的符号链接可修复该错误

    ldd swig 
        linux-vdso.so.1 =>  (0x00007fffd6137000)
        libpcre.so.1 => not found
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fd64fcb6000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fd64faa0000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd64f6d6000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd64f3cd000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fd650038000)

让我们找到prce.so.1

    ldconfig -p | grep libpcre
        libpcre32.so.3 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpcre32.so.3
        libpcre32.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpcre32.so
        libpcre16.so.3 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpcre16.so.3
        libpcre16.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpcre16.so
        libpcre2-32.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpcre2-32.so.0
        libpcre2-32.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpcre2-32.so
        libpcre2-16.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpcre2-16.so.0
        libpcre2-16.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpcre2-16.so
        libpcre2-8.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpcre2-8.so.0
        libpcre2-8.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpcre2-8.so
        libpcre2-posix.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpcre2-posix.so.0
        libpcre2-posix.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpcre2-posix.so
        libpcreposix.so.3 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpcreposix.so.3
        libpcreposix.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpcreposix.so
        libpcrecpp.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpcrecpp.so.0
        libpcrecpp.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpcrecpp.so
        libpcre.so.3 (libc6,x86-64) => /lib/x86_64-linux-gnu/libpcre.so.3
        libpcre.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpcre.so
        libpcre++.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpcre++.so.0
        libpcre++.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpcre++.so

创建链接

    sudo ln -s libpcre.so.3 libpcre.so.1

现在可以正常工作

ldd swig
    linux-vdso.so.1 =>  (0x00007ffca79e1000)
    libpcre.so.1 => /lib/x86_64-linux-gnu/libpcre.so.1 (0x00007f53a15ed000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f53a126b000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f53a1055000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f53a0c8b000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f53a0a6e000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x

希望有帮助

答案 1 :(得分:0)

尝试并运行:

ldconfig -p | grep libpcre.so.1

如果不返回任何内容,请尝试查找库中是否有libpcre.so.1

尝试:

ls /usr/lib/ | grep libpcre.so.1
ls /usr/local/lib/ | grep libpcre.so.1
ls /lib/ | grep libpcre.so.1
ls /lib64/ | grep libpcre.so.1
rpm -ql pcre

如果上面列出的任何命令返回路径,请将其导出到LD_LIBRARY_PATH

例如,您在libpcre.so.1中找到/lib64,执行:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib64

如果你没有运气,请尝试重新安装apache以重新安装其依赖项。

答案 2 :(得分:0)

  • 您好,就我而言,只有libpcre.so.1可用

    1. $ ldd httpd

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

    libpcre.so.1 =>找不到

    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6(0x00007fd64f6d6000)

    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6(0x00007fd64f3cd000) /lib64/ld-linux-x86-64.so.2(0x00007fd650038000)

    1. Ran $ ldconfig -p | grep libpcre

找到了/lib64/libpcre.so.0 cd / lib64 找到2个libpcre文件libpcre.so.0和libpcre.so.0.0.1

  1. 创建的链接$ ln -s libpcre.so.0.0.1 libpcre.so.1

$ ldd httpd linux-vdso.so.1 =>(0x00007fffd6137000)

libpcre.so.1 => /lib64/libpcre.so.1

libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6(0x00007fd64f6d6000)

libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6(0x00007fd64f3cd000) /lib64/ld-linux-x86-64.so.2(0x00007fd650038000)

完成httpd -V httpd正确加载。