passenger icon indicating copy to clipboard operation
passenger copied to clipboard

Can't compile Passenger module with Nginx without PCRE support

Open cici08 opened this issue 10 years ago • 3 comments

Im trying to compile nginx with the Passenger-module and running the following ./configure-command: ./configure --prefix=/ipt/nginx --add-dynamic-module=/var/lib/gems/2.3.0/gems/passenger-5.0.27/src/nginx_module --add-module=/home/jessica/spnego-http-auth-nginx-module --without-http_rewrite_module

The ./configure-Command works, but when I try to compile with make, I get the following error:

make -f objs/Makefile
make[1]: Entering directory `/home/jessica/nginx-1.9.14'
cc -c -fPIC -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /var/lib/gems/2.3.0/gems/passenger-5.0.27/src -I objs -I src/http -I src/http/modules \
        -o objs/addon/nginx_module/Configuration.o \
        /var/lib/gems/2.3.0/gems/passenger-5.0.27/src/nginx_module/Configuration.c
/var/lib/gems/2.3.0/gems/passenger-5.0.27/src/nginx_module/Configuration.c: In function ‘traverse_location_confs_nested_in_server_conf’:
/var/lib/gems/2.3.0/gems/passenger-5.0.27/src/nginx_module/Configuration.c:1145:22: error: ‘ngx_http_core_loc_conf_t’ has no member named ‘regex_locations’
         location_conf->regex_locations, ctx);
                      ^
/var/lib/gems/2.3.0/gems/passenger-5.0.27/src/nginx_module/Configuration.c:1146:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
cc1: all warnings being treated as errors
make[1]: *** [objs/addon/nginx_module/Configuration.o] Error 1
make[1]: Leaving directory `/home/jessica/nginx-1.9.14'
make: *** [build] Error 2

As you can see I am using Passenger Version 5.0.27 installed from ruby gems and nginx 1.9.14 OS is Ubuntu 14.04 LTS x64

I can't find anything about this error on google or here on git. It also won't work if I try to install Passenger as a static module, same error

cici08 avatar Apr 13 '16 10:04 cici08

Did you try to use passenger-install-nginx-module?

OnixGH avatar Apr 13 '16 10:04 OnixGH

This issue has got nothing to do with the Nginx version. The issue occurs when Nginx is configured without PCRE support. The regex_locations field is only defined if the NGX_PCRE macro is defined, so we need to insert a couple of ifdefs in our code.

FooBarWidget avatar Apr 20 '16 12:04 FooBarWidget

@cici08 to clarify, when you specify --without-http_rewrite_module, the configure command disables use of the PCRE library. Passenger assumed it was available, thus the compilation failed.

I've added a fallback for when this dependency is not available, which fixes the compilation issue for me.

OnixGH avatar Apr 20 '16 15:04 OnixGH