linux版本:CentOS 6.X
如题,在编译nginx 1.2.x遇到如下错误的解决方法
错误:src/core/ngx_regex.c:307: undefined reference to `pcre_free_study'
解决方法:
# ./configure \
--user=www \
--group=www \
--prefix=/usr/local/server/nginx \
--with-http_stub_status_module \
--with-http_ssl_module \
--with-http_sub_module \
--with-pcre=../pcre-8.32 --with-pcre-jit
可以发现除了一般的指定用户,用户组,安装目录,模块之外还增加了
--with-pcre=../pcre-8.31 --with-pcre-jit
而且pcre就在nginx的上一层目录版本为8.31,如果你的路径不是这个要注意更改,添加次参数之后即可解决如题的问题。
然后重新编译安装
# make clean
# make
# make install