php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Your vote has been updated.
Bug #61196 Unable to load dynamic library, undefined symbol
Submitted: 2012-02-27 19:53 UTC Modified: 2013-02-18 00:35 UTC
Votes:26
Avg. Score:4.4 ± 0.8
Reproduced:22 of 23 (95.7%)
Same Version:2 (9.1%)
Same OS:9 (40.9%)
From: floren at yqed dot com Assigned:
Status: No Feedback Package: Dynamic loading
PHP Version: 5.3.10 OS: CentOS 5.7
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2012-02-27 19:53 UTC] floren at yqed dot com
Description:
------------
I compiled successfully PHP with the following configuration:
http://pastie.org/3474406

Everything works as expected, except when I run PHP from command line.
I was wondering if I missed something, thank you for your help.

Test script:
---------------
# php -r 'echo 1;'
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/mysql.so' - /usr/lib64/php/modules/mysql.so: undefined symbol: _mysqlnd_fetch_lengths in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/mysqli.so' - /usr/lib64/php/modules/mysqli.so: undefined symbol: mysqlnd_get_client_version in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pdo_mysql.so' - /usr/lib64/php/modules/pdo_mysql.so: undefined symbol: mysqlnd_allocator in Unknown on line 0
1


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-02-27 20:00 UTC] floren at yqed dot com
Please note the --enable-mysqlnd, present into build() function.
I'm forced to use it, or else the mysqli related functions are not available into 
phpinfo(). I obtain the same results, if I force to "yes" the PHP_MYSQLND_ENABLED 
variable:

PHP_MYSQLND_ENABLED=yes
export PHP_MYSQLND_ENABLED
 [2012-05-02 07:13 UTC] uw@php.net
-Status: Open +Status: Feedback
 [2012-05-02 07:13 UTC] uw@php.net
There seem to be multiple build targets in your script. Please, paste the one into a bug system comment that leads to the error. Thanks.
 [2013-02-18 00:35 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 [2013-12-16 06:18 UTC] floren at yqed dot com
Here it is the new %build section I use for PHP 5.5.7:
http://pastie.org/private/ufwgue8ipdpfko4aejv0g

I have issues when I start the php-fpm service:
[root@apollo ~]# service php-fpm start
Starting php-fpm: [16-Dec-2013 00:34:58] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/mysql.so' - /usr/lib64/php/modules/mysql.so: undefined symbol: _mysqlnd_fetch_lengths in Unknown on line 0
[16-Dec-2013 00:34:58] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/mysqli.so' - /usr/lib64/php/modules/mysqli.so: undefined symbol: mysqlnd_get_client_version in Unknown on line 0
                                                           [  OK  ]
 [2013-12-16 06:50 UTC] floren at yqed dot com
I forgot to mention that the build is made on CentOS 6.5 x86_64.
 [2013-12-17 02:21 UTC] floren at yqed dot com
/usr/bin/mysql_config:
http://pastie.org/private/umb81fprsj8w2hsyivytzg
 [2013-12-21 03:31 UTC] floren at yqed dot com
I found the issue, is related to the loading order of mysql modules.
If you load mysql.so or mysqli.so before mysqlnd.so, you will get this error. The solution is to rename the modules, so they are loaded into correct order, i.e.:
mysql.so > mysqlnd_mysql.so
mysqli.so > mysqlnd_mysqli.so
pdo_mysql.so > pdo_mysqlnd.so

Then, PHP will load the modules into proper order:
mysqlnd.so
mysqlnd_mysql.so
mysqlnd_mysqli.so
pdo_mysqlnd.so

This is an ugly workaround, the proper solution is when you --enable-mysqlnd, the modules should be automatically renamed at build time for sanity reasons. Further more, we could define a specific loading order, something like:
...
50_mysqlnd.so
60_mysql.so
70_mysqli.so
80_pdo_mysqlnd.so
...

The PHP developer team is more in measure to define the proper PHP module loading order. Looking forward to hear your comments on that matter.
 [2016-01-01 17:14 UTC] mauricio dot pronet at gmail dot com
I have the same issue with Fedora 23 and PHP 7.0.1

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/mysql.so' - /usr/lib64/php/modules/mysql.so: undefined symbol: mysqlnd_connect in Unknown on line 0
PHP 7.0.1 (cli) (built: Dec 16 2015 14:54:25) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies

I've tryid renaming like this:

mysql.so > mysqlnd_mysql.so
mysqli.so > mysqlnd_mysqli.so
pdo_mysql.so > pdo_mysqlnd.so

but the problem continues.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 00:01:28 2024 UTC