Closed remicollet closed 6 years ago
this RTLD_LAZY dl open hide such issue (with standard PHP build), with RTLD_NOW (in linux distro) you can't load the extension (btw, IMHO, better than segfault at runtime)
More information on https://derickrethans.nl/undefined-symbol.html
i am also getting PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/molten.so' - /usr/lib64/php/modules/molten.so: undefined symbol: php_json_decode_ex in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/molten.so' - /usr/lib64/php/modules/molten.so: undefined symbol: php_pdo_get_exception in Unknown on line 0
tried adding extension=json.so before of extension=molten.so in php.ini then the warning becomes PHP Warning: Module 'json' already loaded in Unknown on line 0 PHP Warning: Module 'PDO' already loaded in Unknown on line 0
@atul016 load order matters, so molten shoudl be loaded "after" json, curl and pdo
@remicollet @atul016 i am already load molten after json/curl/pdo
static const zend_module_dep molten_deps[] = {
ZEND_MOD_REQUIRED("json")
ZEND_MOD_REQUIRED("standard")
ZEND_MOD_REQUIRED("curl")
ZEND_MOD_OPTIONAL("memcached")
ZEND_MOD_OPTIONAL("redis")
ZEND_MOD_OPTIONAL("mongodb")
ZEND_MOD_OPTIONAL("mysqli")
ZEND_MOD_OPTIONAL("PDO")
ZEND_MOD_END
};
@remicollet other problem resovling
@silkcutKs no. ZEND_MOD_REQUIRED only manage "init" order.
With RTLD_NOW (see above link), load order (so extension directives order) matters.
The reason why, linux distro, use a numerical prefix for configuration file.
Example on Fedora, in /etc/php.d
20-curl.ini
20-json.ini
20-pdo.ini
30-mysqli.ini # after 20-mysqlnd...
50-memcached.ini # after 40-igbinary...
50-mongodb.ini
50-redis.ini
60-molten.ini # use 60 to be great than all deps.
@atul016 which distro are you using ?
@remicollet I have verify the issue at my build version replace RTLD_LAZY with RTLD_NOW, the problem exist. have other method to solve the problem?
@remicollet some error i have remove.
have other method to solve the problem?
No, load order have to be managed.
People using distro packages for PHP should NOT install extension from sources, but also use distro packkages ;) and thus, this is a downstream issue.
@silkcutKs indeed, undefined symbols are fixed (but still have lot of -Wimplicit-function-declaration)
$ php -n -d extension=json.so -d extension=curl.so -d extension=pdo.so -d extension=modules/molten.so -m
[PHP Modules]
Core
curl
date
filter
hash
json
libxml
molten
openssl
pcntl
pcre
PDO
readline
Reflection
session
SPL
standard
zlib
[Zend Modules]
@remicollet thankyou for verify. BTW, molten tracing extension detail infomation, sometimes need the extension internal function. if the user tracing their app, they should build from source to adapt their env.
@silkcutKs do you mean it doesn't make sense to provide binary package for this extension ?
(FYI see: https://blog.remirepo.net/pages/PECL-extensions-RPM-status)
@remicollet there is some limits for molten. here is hard deps extension : json, standard,curl.(without this, can not run) soft deps : mysqli, pdo(without this, can not support full functions)
if provide binnary package, i think the full functions supported is good. do you have some suggest????
@silkcutKs of course, for downstream distribution, all ZENDMOD described dependencies will be available (as package dependencies)
@remicollet
All I want to say is "all dependecies will be available is great!!!"
@remicollet the distribution that we support complete functions to urge users to add other extension, is that ok?
Sorry, haven't understood
@remicollet
All I want to say is "all dependecies will be available is great!!!"
@remicollet i am using CentOS Linux release 7.3.1611
@atul016 so, use my repo, you will have most possible extensions available ;)
And this one will be available, as soon as a new release fixing this issue will be published
@atul016 please use remi repo, it is really comfortable for phper to manager extension.
PHP Warning: PHP Startup: Unable to load dynamic library 'modules/molten.so' - modules/molten.so: undefined symbol: MOLTEN_ERROR in Unknown on line 0
And indeed, lot of -Wimplicit-function-declaration during the build, some of them