9

Nginx添加第三方模块,出现“is not binary compatible in”错误的解决方案 - Tinywan

 6 months ago
source link: https://www.cnblogs.com/tinywan/p/18038318
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Nginx添加第三方模块,出现“is not binary compatible in”错误的解决方案

动态编译好第三方模块:ngx_http_ts_module.so 检测nignx配置,异常

sudo /usr/local/openresty/nginx/sbin/nginx -t
nginx: [emerg] module "/usr/local/openresty/nginx/modules/ngx_http_ts_module.so" is not binary compatible in /usr/local/openresty/nginx/conf/nginx.conf:7
nginx: configuration file /usr/local/openresty/nginx/conf/nginx.conf test failed

第三方模块的编译中包含的签名和使用的nignx不一致

./configure --prefix=/usr/local/openresty --with-luajit --without-http_redis2_module --with-http_iconv_module --with-http_stub_status_module --with-http_xslt_module --add-dynamic-module=/home/www/build/nginx-ts-module

先通过 nginx -V 命令得到当前配置的configure配置

/usr/local/openresty/nginx/sbin/nginx -V

nginx version: openresty/1.19.3.1
built by gcc 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
built with OpenSSL 1.1.1 11 Sep 2018
TLS SNI support enabled
configure arguments: --prefix=/usr/local/openresty/nginx --with-cc-opt='-O2 -O3' --add-module=../ngx_devel_kit-0.3.1 --add-module=../iconv-nginx-module-0.14 --add-module=../echo-nginx-module-0.62 --add-module=../xss-nginx-module-0.06 --add-module=../ngx_coolkit-0.2 --add-module=../set-misc-nginx-module-0.32 --add-module=../form-input-nginx-module-0.12 --add-module=../encrypted-session-nginx-module-0.08 --add-module=../srcache-nginx-module-0.32 --add-module=../ngx_lua-0.10.19 --add-module=../ngx_lua_upstream-0.07 --add-module=../headers-more-nginx-module-0.33 --add-module=../array-var-nginx-module-0.05 --add-module=../memc-nginx-module-0.19 --add-module=../redis-nginx-module-0.3.7 --add-module=../rds-json-nginx-module-0.15 --add-module=../rds-csv-nginx-module-0.09 --add-module=../ngx_stream_lua-0.0.9 --with-ld-opt=-Wl,-rpath,/usr/local/openresty/luajit/lib --with-pcre-jit --with-stream --with-stream_ssl_module --with-stream=dynamic --with-file-aio --with-threads --with-http_v2_module --with-http_realip_module --with-http_mp4_module --with-http_gzip_static_module --with-http_ssl_module --with-http_stub_status_module --with-http_xslt_module --with-openssl-opt='-g enable-tlsext' --with-stream --with-stream_ssl_preread_module

在复制所有的配置命令。添加到:

./configure [“你的nignx -V 得到的配置参数”] --add-dynamic-module=/etc/pan1/fastdfs-nginx-mo

正确的应该是

./configure --prefix=/usr/local/openresty/nginx --with-cc-opt='-O2 -O3' --with-ld-opt=-Wl,-rpath,/usr/local/openresty/luajit/lib --with-pcre-jit --with-stream --with-stream_ssl_module --with-stream=dynamic --with-file-aio --with-threads --with-http_v2_module --with-http_realip_module --with-http_mp4_module --with-http_gzip_static_module --with-http_ssl_module --with-http_stub_status_module --with-http_xslt_module --with-openssl-opt='-g enable-tlsext' --with-stream --with-stream_ssl_preread_module --add-dynamic-module=/home/www/build/nginx-ts-module

重新生成第三方模块。接下来该怎么配置就怎么配置。问题解决!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK