• 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 



  • 相关阅读:
    飞思卡尔单片机CAN模块的物理特性的示波器观察
    飞思卡尔CAN模块关于ID和mask的使用
    基本数据库语句
    深入分析Spring 与 Spring MVC容器
    Linux常用命令大全
    datagrid行内编辑时为datetimebox
    SVN上拖下来的项目,缺少build path怎么办?
    sql中的in与not in,exists与not exists的区别
    Spring中@Component的作用
    浅谈@RequestMapping @ResponseBody 和 @RequestBody 注解的用法与区别
  • 原文地址:https://www.cnblogs.com/mengfanrong/p/3776181.html
Copyright © 2020-2023  润新知