./configure --prefix=/mynginx/

本地编译nginx的时候 报错 提示需要安装PCRE

错误信息:

./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.

下载最新版本pcre

地址:http://www.pcre.org.

解压到路经

/usr/local/src
我下载安装的是pcre2-10.32.tar
cd pcre2-10.32
./configure --prefix=/usr/local
详细操作流程
cd /usr/local/src
tar pcre2-10.32.tar
cd pcre2-10.32
./configure --prefix=/usr/local make sudo make install

安装成功之后 

重新回去编译nginx
根据错误信息 需要增加参数 指定PCRE library的路经地址

./configure --prefix=/mynginx/  --with-pcre=/usr/local/

重新编译 成功.

修正:

1、

./configure --prefix=/mynginx/  --with-pcre=/usr/local/

其中参数制定的是pcre源码库的位置路经 不是设置的prefix

2、不可以用pcre2 用pcre2会报错

src/core/ngx_regex.h:15:10: fatal error: 'pcre.h' file not found
#include <pcre.h>
^~~~~~~~
1 error generated.

最终的执行

./configure --prefix=/mynginx/ --with-pcre=/Users/qiaodan/pcre-8.42 --with-openssl=/Users/qiaodan/openssl-1.1.1a --with-http_ssl_module --with-http_v2_module

结果:

编译nginx的时候报错 需要安装PCRE的更多相关文章

  1. Nginx的各种报错总结

    1.Nginx安装过程报错 错误一:软件依赖包未正确安装问题---PCRE依赖包没有安装 ./configure: error: the HTTP rewrite module requires th ...

  2. Nginx配置SSL报错 nginx: [emerg] unknown directive "ssl"

    Nginx配置SSL报错 nginx: [emerg] unknown directive "ssl"     出现如图所示错误,处理办法如下 去nginx解压目录下执行 ./co ...

  3. nginx集群报错“upstream”directive is not allow here 错误

    nginx集群报错“upstream”directive is not allow here 错误 搭建了一个服务器, 采用的是nginx + apache(多个) + php + mysql(两个) ...

  4. 运行编译后的程序报错 error while loading shared libraries: lib*.so: cannot open shared object file: No such file or directory

    运行编译后的程序报错  error while loading shared libraries: lib*.so: cannot open shared object file: No such f ...

  5. Xcode 编译运行旧项目报错解决之路

    运行几年前做的项目,发现各种编译报错,一个一个解决记录下: 1.Xcode(Xcode9)编译运行报错,但是在 issue navigatior 栏看不到错误信息: 解决方案:在 show repor ...

  6. 安装Nginx的各种报错的解决

    如题,本人环境Ubuntu14.0虚拟机,安装一个nginx服务器来运行我的fastDfs文件管理的.但是安装出现了各种问题: sudo ./configure --prefix=/usr/local ...

  7. Linux make nginx 的时候报错

    报错如下: `conf/koi-win' and `/usr/local/nginx/conf/koi-win' are the same file   原因: 可能在编译 nginx 的时候步骤不对 ...

  8. thinkphp3.2.3 nginx 连接mysql 报错 new PDO 异常

    在 php.ini 里重新指定mysql.sock 路径 pdo_mysql.default_socket=/Applications/XAMPP/xamppfiles/var/mysql/mysql ...

  9. VS项目中使用Nuget还原包后编译生产还一直报错?

    Nuget官网下载Nuget项目包的命令地址:https://www.nuget.org/packages 今天就遇到一个比较奇葩的问题,折腾了很久终于搞定了: 问题是这样的:我的解决方案原本是好好的 ...

随机推荐

  1. 使用NLP从文章中自动提取关键字

    背景 在研究和新闻文章中,关键词构成了一个重要的组成部分,因为它们提供了文章内容的简洁表示.关键词在从信息检索系统,书目数据库和搜索引擎优化中定位文章方面也起着至关重要的作用.关键词还有助于将文章分类 ...

  2. Java 多线程 -- 线程安全 双重检测(double checking)

    先看一个经典的12306案例: public class SynBlockTest { public static void main(String[] args) { // 一份资源 SynWeb1 ...

  3. scrollview 和 listview滑动冲突解决

    http://blog.csdn.net/wanghao200906/article/details/51084975 http://www.cnblogs.com/shitianzeng/artic ...

  4. docker 搭建一个wordpress 博客系统(4)

    安装lnmp ()下载镜像 [root@server ~]# docker pull mysql:latest #下载mysql镜像 [root@server ~]# docker pull rich ...

  5. 企业级 Harbor 镜像仓库

    Harbor是由VMWare公司开源的容器镜像仓库.事实上,Harbor是在Docker Registry上进行了相应 的企业级扩展,从而获得了更加广泛的应用,这些新的企业级特性包括:管理用户界面,基 ...

  6. hdu_1052 Tian Ji -- The Horse Racing 贪心

    Tian Ji -- The Horse Racing Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (J ...

  7. Linux分类

    Linux versions:http://www.cnblogs.com/sammyliu/articles/4832157.html1. Maintained by organization- D ...

  8. 工具 在 Nuget 发布自己的包

    MSDN : https://docs.microsoft.com/zh-cn/nuget/quickstart/create-and-publish-a-package-using-visual-s ...

  9. 跟风微信小程序,生鲜水果店如何借力小程序每天多赚2万块?

    公司旁边的水果店,虽然是一家实体店,但老板有一颗爱玩互联网的心. 老板非常重视线上的营销推广,什么新的线上推广方式都爱尝试一下.公众号大热时做了自己的微信公众号,并且有自己的微信商城,不过线上的销售一 ...

  10. 数学--数论--随机算法--Pollard Rho 大数分解算法(纯模板带输出)

    ACM常用模板合集 #include <bits/stdc++.h> using namespace std; typedef long long ll; ll pr; ll pmod(l ...