zoukankan      html  css  js  c++  java
  • libpcre.so.1 cannot be found

    安装完Nginx之后,启动报错。

    [vagrant@localhost sbin]$ sudo ./nginx

    ./nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory

    运行ldd命令,找到Nginx的依赖共享库文件。

    vagrant@localhost sbin]$ ldd $(which /usr/local/nginx/sbin/nginx)

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

    libpthread.so.0 => /lib64/libpthread.so.0 (0x00000032b2600000)

    libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00000032b3a00000)

    libpcre.so.1 => not found

    libcrypto.so.6 => /lib64/libcrypto.so.6 (0x00000032b4200000)

    libc.so.6 => /lib64/libc.so.6 (0x00000032b1a00000)

    /lib64/ld-linux-x86-64.so.2 (0x00000032b1600000)

    libdl.so.2 => /lib64/libdl.so.2 (0x00000032b1e00000)

    libz.so.1 => /usr/lib64/libz.so.1 (0x00000032b3200000)

    原来是真的没找到libpcre.so.1文件。

    进入lib64文件夹,对libpcre.so.0.0.1做软连接。

    [vagrant@localhost lib64]$ cd /lib64/

    [vagrant@localhost lib64]$ sudo ln -s libpcre.so.0.0.1 libpcre.so.1

    再次运行ldd命令,就能够找到libpcre.so.1依赖库了。

    [vagrant@localhost lib64]$ ldd $(which /usr/local/nginx/sbin/nginx)

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

    libpthread.so.0 => /lib64/libpthread.so.0 (0x00000032b2600000)

    libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00000032b3a00000)

    libpcre.so.1 => /lib64/libpcre.so.1 (0x00000032b1e00000)

    libcrypto.so.6 => /lib64/libcrypto.so.6 (0x00000032b4200000)

    libc.so.6 => /lib64/libc.so.6 (0x00000032b1a00000)

    /lib64/ld-linux-x86-64.so.2 (0x00000032b1600000)

    libdl.so.2 => /lib64/libdl.so.2 (0x00002aebb7623000)

    libz.so.1 => /usr/lib64/libz.so.1 (0x00000032b3200000)


    ok, 如今就能够成功启动Nginx。

    [vagrant@localhost sbin]$ sudo ./nginx

    [vagrant@localhost sbin]$ sudo netstat -ntlp | grep nginx

    tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      17529/nginx 



  • 相关阅读:
    LeetCode5 Longest Palindromic Substring
    LeetCode4 Median of Two Sorted Arrays
    LeetCode3 Longest Substring Without Repeating Characters
    LeetCode2 Add Two Numbers
    LeetCode1 Two Sum
    算法总结—深度优先搜索DFS
    c++ 设计模式9 (Abstract Factory 抽象工厂模式)
    题解 P3374 【【模板】树状数组 1】
    题解 HDU1565 【方格取数(1)】
    题解 P2431 【正妹吃月饼】
  • 原文地址:https://www.cnblogs.com/mengfanrong/p/3776181.html
Copyright © 2011-2022 走看看