配置nginx安装信息时报错 ./configure: error: the HTTP rewrite module requires the PCRE library.You can..... 处理

出现错误过程:

Linux终端运行nginx配置信息:(运行后,发现最后一行需要修改)

./configure \
--prefix=/usr/local/nginx \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--with-http_gzip_static_module \
--http-client-body-temp-path=/var/temp/nginx/client \
--http-proxy-temp-path=/var/temp/nginx/proxy \
--http-fastcgi-temp-path=/var/temp/nginx/fastcgi \
--http-uwsgi-temp-path=/var/temp/nginx/uwsgi \
--http-scgi-temp-path=/var/temp/nginx/scgi \
--add-module=/usr/local/fastdfs/fastdfs-nginx-module-1.22/src

于是修改最后一行后,再次运行,就出现了报错所示的内容

(修改最后一行)

./configure \
--prefix=/usr/local/nginx \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--with-http_gzip_static_module \
--http-client-body-temp-path=/var/temp/nginx/client \
--http-proxy-temp-path=/var/temp/nginx/proxy \
--http-fastcgi-temp-path=/var/temp/nginx/fastcgi \
--http-uwsgi-temp-path=/var/temp/nginx/uwsgi \
--http-scgi-temp-path=/var/temp/nginx/scgi \
--add-module=/usr/local/software/fastdfs/fastdfs-nginx-module-1.22/src

具体报错:

配置nginx安装信息时报错 ./configure: error: the HTTP rewrite module requires the PCRE library.You can..... 处理_第1张图片

 报错文本内容:

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

报错内容分析:

原因是PCRE包没有安装,不允许你重写之前配置过的内容,

解决办法:

Linux中运行如下安装命令:

yum -y install pcre-devel

 安装完成后,再次运行你修改后的配置信息

./configure \
--prefix=/usr/local/nginx \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--with-http_gzip_static_module \
--http-client-body-temp-path=/var/temp/nginx/client \
--http-proxy-temp-path=/var/temp/nginx/proxy \
--http-fastcgi-temp-path=/var/temp/nginx/fastcgi \
--http-uwsgi-temp-path=/var/temp/nginx/uwsgi \
--http-scgi-temp-path=/var/temp/nginx/scgi \
--add-module=/usr/local/software/fastdfs/fastdfs-nginx-module-1.22/src

 这样,配置信息就能运行成功了

参考1:https://www.cnblogs.com/tudou1179006580/p/14875457.html

参考2:https://blog.csdn.net/yuntiank/article/details/8548147?locationNum=12

参考3:https://www.huaweicloud.com/articles/13235540.html

你可能感兴趣的:(Others,nginx,nginx反向代理)