./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. python 工具链 虚拟环境和包管理工具 pipenv

    Pipenv is a tool that aims to bring the best of all packaging worlds (bundler, composer, npm, cargo, ...

  2. golang 基础 map及工厂函数

    Map是一种数据结构,是一个集合,用于存储一系列无序的键值对.它基于键存储的,键就像一个索引一样,这也是Map强大的地方,可以快速快速检索数据,键指向与该键关联的值. 内部实现 Map是基于 散列表 ...

  3. kubernetes的headless service介绍

    headless service是一个特殊的ClusterIP类service,这种service创建时不指定clusterIP(--cluster-ip=None),因为这点,kube-proxy不 ...

  4. audio的自动播放报错解决

    使用audio标签时,当前页面没有进行交互时,比如用户刷新了页面后,play()调用就会报错,如下图 查找资料后,发现是2018年4月以后,chrome浏览器对这块进行了优化,为了节约流量,禁止了自动 ...

  5. Redis来限制用户 ------------IP某个时间段内访问的次数

    $redis = new Redis(); $redis->connect('127.0.0.1', 6379); //获取客户端真实ip地址 function get_real_ip(){ s ...

  6. AIX如何点亮HBA卡

    不要选中分区,选择系统管理下的服务器即可 LED状态----->启动Advanced System Management(ASM) UserID:  admin Password:admin S ...

  7. Eclipse Mac OS版 卸载svn插件subclipse

    点击Eclipse -> About Eclipse 在打开的窗口中点击Installation Details(安装细节) 在Installed Software标签窗口中,选中Subclip ...

  8. jQuery学习(二)

    操作DOM对象: 修改文本: jQuery对象的text()和html()方法可以用来获取节点的文本内容和HTML文本.而当你给方法传入参数时,这两个方法可以被用于设置jQuery的文本内容. 还是以 ...

  9. Joomla CMS 3.2-3.4.4 SQL注入 漏洞分析

    RickGray · 2015/10/26 11:24 昨日,Joomla CMS发布新版本3.4.5,该版本修复了一个高危的SQL注入漏洞,3.2至3.4.4版本都受到影响.攻击者通过该漏洞可以直接 ...

  10. CodeForces - 1245 C - Constanze's Machine

    Codeforces Round #597 (Div. 2) Constanze is the smartest girl in her village but she has bad eyesigh ...