./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. ADO.Net和Entity Framework的区别联系

    它们有以下几点区别:1,ADO.Net是开发人员自己select.update等写sql语句,来实现对数据库的增删改查等操作:采用EF进行开发操作数据库的时候,只需要操作对象,这样做使开发更方便,此时 ...

  2. Java去除ArrayList集合中重复字符串的案例

    ArrayList去除集合中的字符串重复值 分析: A:创建集合对象 B:添加多个字符串元素 C:创建新集合 D:遍历旧集合,获取得到每一个元素 E:拿着个元素到新集合去找,看有没有 有:不进去 没有 ...

  3. Spring基于注解@Required配置

    基于注解的配置 从 Spring 2.5 开始就可以使用注解来配置依赖注入.而不是采用 XML 来描述一个 bean 连线,你可以使用相关类,方法或字段声明的注解,将 bean 配置移动到组件类本身. ...

  4. Centos8安装docker-compose

    一.首先检查是否有pip 执行命令:piv -V 二.更新pip 执行命令:pip install --upgrade pip 三.下载  setuptools 执行命令 :pip install - ...

  5. 【FishFX】花式撩骚,打造TypeScript易用框架。

    · 栗子入手 假设有以下foo数组,数组中每个对象都拥有id,name两个属性,现在需要查找id > 0的对象数量. const foo: Array<{ id: number, name ...

  6. Windows API 中 OVERLAPPED 结构体 初始化

    出处:https://github.com/microsoft/Windows-classic-samples/blob/1d363ff4bd17d8e20415b92e2ee989d615cc0d9 ...

  7. Spring Boot中的测试

    文章目录 简介 添加maven依赖 Repository测试 Service测试 测试Controller @SpringBootTest的集成测试 Spring Boot中的测试 简介 本篇文章我们 ...

  8. Express 文档(常见问题)

    常见问题 我该如何构建我的应用程序? 这个问题没有明确的答案,答案取决于你的应用程序规模和所涉及的团队,为了尽可能灵活,Express在结构方面没有做出任何假设. 在你喜欢的任何目录结构中,路由和其他 ...

  9. [CodeForces-259C] Little Elephant and Bits

    C. Little Elephant and Bits time limit per test 2 seconds memory limit per test 256 megabytes input ...

  10. P4370 [Code+#4]组合数问题2

    题目要求当\(0\leq a\leq b\leq n\)时,\(k\)个\(\tbinom{b}{a}\)的和的最大值 观察杨辉三角形,可以发现,最大的\(\tbinom{b}{a}\),为\(\tb ...