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

结果:

最新文章

  1. Xamarin Studio在Mac环境下的配置和Xamarin.iOS常用控件的示例
  2. Spring中的JDK动态代理
  3. linux mail 使用外部邮箱地址发邮件
  4. iOS 集成银联支付
  5. vim代码补全-spf13,YouCompleteMe
  6. NHibernate与EF(Entity Framework)的区别
  7. Java面试题之一
  8. Android ProgressBar 反向进度条/进度条从右到左走
  9. Define Constraints That Are Minimal and Sufficient 设定不多不少的约束
  10. Storm实践
  11. 好久没有写BLOG了,人老了就开始变懒了【非技术】
  12. Java复制、移动和删除文件
  13. Lodop、c-lodop注册与角色简短问答
  14. matplot绘图基本使用
  15. python2判断编码格式
  16. 【Alpha版本】冲刺阶段——Day1
  17. telegraph.conf配置
  18. 工欲善其事,必先利其器 软件工具开发关键词 protractor自动化测试工具 RegexBuddy正则 CodeSmith,LightSwitch:代码生成 CheatEngine:玩游戏修改内存值必备神器 ApkIDE:Android反编译工具 Reflector:反编译dll动态链接库
  19. IO流的各种继承关系
  20. UE如何使用正则表达式

热门文章

  1. python调用word2vec工具包安装和使用指南
  2. Liunx常用操作(一)-删除命令
  3. 【原创】Linux RCU原理剖析(二)-渐入佳境
  4. java IO流 之 字节流与字符流
  5. 轻量级mysql安装教程-避免采坑
  6. 云开发网站托管悄悄上线了 Next.js 的支持
  7. mysql 复制表结构和数据
  8. Display a QMessageBox from a QThread
  9. abp(net core)+easyui+efcore实现仓储管理系统——入库管理之十(四十六)
  10. tomcat启动日志中中文乱码