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
586 stars 56 forks source link

undefined symbol: zif_dl #30

Closed theraw closed 5 years ago

theraw commented 5 years ago

I was able to compile it without any problem however after i add load on nginx.conf and i tried nginx -t i got this err

nginx: [emerg] dlopen() "/etc/nginx/modules/ngx_http_php_module.so" failed (/etc/nginx/modules/ngx_http_php_module.so: undefined symbol: zif_dl) in /etc/nginx/nginx.conf:15

i was searching around but found nothing about this, can you please help?

root@proxy2:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.10
Release:    18.10
Codename:   cosmic

root@proxy2:~# php -v
PHP 7.0.33-1+ubuntu18.10.1+deb.sury.org+1 (cli) (built: Dec  7 2018 08:28:57) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.3.2, Copyright (c) 2002-2018, by ionCube Ltd.
    with Zend OPcache v7.0.33-1+ubuntu18.10.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies

root@proxy2:~# nginx -v
nginx version: nginx/1.15.7 (nginx-plus-r17)

root@proxy2:~# cat /nginx/nginx.conf | grep "load"
load_module modules/ngx_http_geoip2_module.so;
load_module modules/ngx_stream_geoip2_module.so;
load_module modules/ndk_http_module.so;
load_module modules/ngx_http_php_module.so;
root@proxy2:~# 
rryqszq4 commented 5 years ago

@theraw You must be found where is libphp7.so, probably at here /usr/lib/libphp7.so, if you don't find and need to install php7 embed. Before compiling ngx_php7, set the environment variable export PHP_LIB=/usr/lib.

Ununtu 16.04 installation example https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/PHP/php/php-ngx.dockerfile

You can give it a try, thank you for your feedback.

theraw commented 5 years ago

libphp7.so was there but was required to use export PHP_LIB=/usr/lib when compiling module.. Thank you