rryqszq4 / ngx-php

ngx-php - Embedded php7 or php8 scripting language for nginx module. Mainline development version of the ngx-php.
BSD 2-Clause "Simplified" License
626 stars 56 forks source link

Build error in gcc 10.1.1 #101

Closed kjdev closed 4 years ago

kjdev commented 4 years ago

You get multiple definitionof 'ngx_php_request', multiple definition of 'old_zend_error_cb' error when building on fedora 32.

...
cc -o objs/ngx_http_php_module.so \
objs/addon/src/ngx_http_php_module.o \
objs/addon/src/ngx_http_php_core.o \
objs/addon/src/ngx_http_php_directive.o \
objs/addon/src/ngx_http_php_handler.o \
objs/addon/src/ngx_http_php_request.o \
objs/addon/src/ngx_http_php_zend_uthread.o \
objs/addon/src/ngx_http_php_sleep.o \
objs/addon/src/ngx_http_php_socket.o \
objs/addon/src/ngx_http_php_util.o \
objs/addon/src/ngx_http_php_variable.o \
objs/addon/src/ngx_http_php_header.o \
objs/addon/src/ngx_http_php_keepalive.o \
objs/addon/src/ngx_php_debug.o \
objs/addon/src/ngx_php_conf_file.o \
objs/addon/impl/php_ngx.o \
objs/addon/impl/php_ngx_core.o \
objs/addon/impl/php_ngx_log.o \
objs/addon/impl/php_ngx_request.o \
objs/addon/impl/php_ngx_socket.o \
objs/addon/impl/php_ngx_var.o \
objs/addon/impl/php_ngx_sockets.o \
objs/addon/impl/php_ngx_header.o \
objs/addon/impl/php_ngx_cookie.o \
objs/ngx_http_php_module_modules.o \
-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-E -Wl,-rpath,/usr/lib64 -lcrypt -lresolv -lcrypt -lncurses -lrt -lstdc++ -lrt -lm -ldl -lxml2 -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lpcre2-8 -lz -ledit -lcrypt -lcrypt -L/usr/lib64 -lphp7 -shared
/usr/bin/ld: objs/addon/src/ngx_http_php_core.o:(.bss+0x0): multiple definitionof `ngx_php_request'; objs/addon/src/ngx_http_php_module.o:(.bss+0x0): first defined here
/usr/bin/ld: objs/addon/src/ngx_http_php_core.o:/app/build/nginx-1.18.0/../../src/ngx_http_php_core.h:177: multiple definition of `old_zend_error_cb'; objs/addon/src/ngx_http_php_module.o:/app/build/nginx-1.18.0/../../src/ngx_http_php_core.h:177: first defined here
..