ubuntu和debian安裝nginx或者tengine報錯, 找不到pcre依賴庫的解決辦法

字號+ 編輯: 种花家 修訂: 种花家 來源: 原创 2023-09-12 我要說兩句(0)

安裝nginx前, 系統自帶的依賴庫, 通常不能滿足nginx安裝的前置要求。本文講述如何安裝其中三個最常見的依賴。

这里介绍一下ubuntu/debian系统的安装方法。首先说说比较熟悉的例子, 比如查找系统是否安装了zlib, 命令如下

dpkg -l | grep zlib

如果不用一键安装包, 自己手动安装nginx的话, 通常会报类似这样的错误:

./configure: error: the HTTP rewrite module requires the PCRE library.

接下来, 系统会提出建议:

You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.

意思就是让你用参数的方式绕过(舍弃http重写模块)或者指定一个pcre的手动安装地址。不过这些建议都不符合实际应用场景。

为了防止反复的报错, 使用以下三个命令安装依赖:

apt-get install openssl libssl-dev
apt-get install libpcre3 libpcre3-dev
apt-get install zlib1g-dev

再去nginx/tengine的安装目录下运行./configure应该就不会报没有依赖的问题了。

閲完此文,您的感想如何?
  • 有用

    0

  • 沒用

    0

  • 開心

    0

  • 憤怒

    0

  • 可憐

    0

1.如文章侵犯了您的版權,請發郵件通知本站,該文章將在24小時内刪除;
2.本站標注原創的文章,轉發時煩請注明來源;
3.交流群: 2702237 13835667

相關課文
  • 防止退出linux終耑退出之後導致的nohup進程強制退出

  • Linux系統下word文档轉成pdf的辦法

  • 常見的web中間件請求返回狀態碼

  • linux終耑下借助awk命令查詢篩出網站access.log日志裡的統計信息

我要說說
網上賓友點評