New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
is not binary compatible #82
Comments
I'm seeing this also using Nginx 1.16 source, then attempting to use the resulting module with Centos/Rhel nginx-1.16 package. Sorry, I don't have any suggested workarounds. |
You need to build nginx and the module with the same build flags. So compiling nginx, then taking its flags and adding --add-dynamic-module to now build the module, unless you also take the nginx binary produced by that build, they will have been built differently. |
Thank you leev. Are you saying the module build failed because nginx itself was not compiled before it? |
No. To my knowledge, nginx and the modules need to be compiled with the same flags. Eg, if you did: You have built nginx with |
$(nginx -V) outputs all the flags of the currently system installed nginx. I never built nginx from source to use it ( only as part of building the module). I use the system installed nginx. |
Yes, I don't believe that is possible. You aren't compiling them with the same flags. Your nginx binary has no knowledge of the module. Please consult the nginx documentation for dynamic modules. |
Leev. You have completely lost me I'm afraid. I have no idea anymore how the module should be compiled. |
The steps I have taken are:
I don't know where I went wrong. Maybe I should specify the flags explicitly. |
Specifying the flags explicitly at the build step ( instead of using $(nginx -V) ) solved the problem. The module loads now. Thank you. |
Thank you for developing this module. Very useful. |
Hi @measwel I having the same issue on the same ubuntu version u have. |
Hi. I just used the command nginx -V and copied all flags output by it: --with-cc-opt='-g -O2 -fdebug-prefix-map=/build/nginx-DUghaW/nginx-1.14.0=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fPIC' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_geoip_module=dynamic --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_sub_module --with-http_xslt_module=dynamic --with-stream=dynamic --with-stream_ssl_module --with-mail=dynamic --with-mail_ssl_module Then I configured the build: Some of these are not necessary, as they define the build of other modules, but I just kept them all. |
The following method allows automation: nginx -V 2>&1 | egrep "^configure" | cut -d: -f2 > /tmp/nginx_build_options.txt
sh -c "./configure $(cat /tmp/nginx_build_options.txt) --add-dynamic-module=..." |
AFAIK, if you want to drop in dynamic built nginx modules, nginx needs to be compiled with
@joaompinto that method may not work depending how Nginx is compiled. For instance all i'd get would be
as opposed to my full Nginx configure on CentOS 7.7 64bit
|
On my specific case I had the requirement to use a RedHat provided nginx image which was built without --compat, and yes that |
Hi ! With nginx-1.14.2 on debian 10 buster (nginx already installed with apt), I've done the following steps:
nginx -t gives :
What the hell I'm doing wrong ? Thanks a lot :) |
This doesn't seem to be so, at least on my Debian 10 nginx install (1.14.2), I also discovered that you needn't include any of the
|
This process of configuring by discovering existing flags should be added into the readme. Once it's understood - and easily findable in the main doc, most people will immediately be able to fix their specific variation of the issue. Many people only compile modules such as this on an ad-hoc basis - having the knowhow to match compile flags exactly does not sit at the top of mind. Admittedly the readme does say to compile direct from source, but it would be super helpful (I think) to add in a small aside in the docs to assist those who might need to contend with alternative build scenarios. I had the same issue - but as soon as I found the flags (nginx -V) and could add them to the --add-dynamic-module during configure, all worked fine. Please consider updating the readme, it may save a few headaches for those who are do this infrequently. Btw - I had the exact same issue a year ago - but had already forgotten (no notes!) - the readme would help enormously for people like me. :-) |
like this:
if error:
|
Thanks for saving me tons of time!! |
Just FYI e.g. missing a PCRE library during geoip2 module build would also cause this error, even if you use correct flags from |
I have build the module with the same nginx version (1.14.0) and the same build flags like this:
./configure --add-dynamic-module=/home/marek/ngx_http_geoip2_module $(nginx -V)
nginx -t shows:
nginx: [emerg] module "/usr/share/nginx/modules/ngx_http_geoip2_module.so" is not binary compatible in /etc/nginx/nginx.conf:5
what could be wrong?
The text was updated successfully, but these errors were encountered: