|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51276 php_load_extension is called when HAVE_LIBDL is not defined.
Submitted: 2010-03-11 18:08 UTC Modified: 2010-06-08 14:54 UTC
Avg. Score:4.4 ± 0.8
Reproduced:5 of 5 (100.0%)
Same Version:4 (80.0%)
Same OS:2 (40.0%)
From: tsteiner at nerdclub dot net Assigned: tony2001 (profile)
Status: Closed Package: Compile Failure
PHP Version: 5.3.2 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
1 + 31 = ?
Subscribe to this entry?

 [2010-03-11 18:08 UTC] tsteiner at nerdclub dot net
When HAVE_LIBDL is not defined in main/php_config.h, the function php_load_extension is not compiled in ext/standard/dl.c.  However, the function php_load_php_extension_cb() will always be compiled with a call to php_load_extension.  This causes compilation to fail with the following message:

main/php_ini.o: In function `php_load_php_extension_cb':
[path removed]/main/php_ini.c:350: undefined reference to `php_load_extension'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

This appears to be the only place php_load_extension is called.  Furthermore, php_load_php_extension_cb is only referenced by php_ini_register_extensions(), which is only called in at main/main.c:2021.  It would seem that on architectures that don't HAVE_LIBDL, the preceding functions should be inside #if defined() checks.

I found this bug while cross-compiling from x86_64 to powerpc but I don't believe it is a cross-compiling issue.

Test script:
CC=${CROSS_COMPILE}gcc ../php-5.3.2/configure --host=powerpc-unknown-linux

Expected result:
PHP should compile without errors.

Actual result:
main/php_ini.o: In function `php_load_php_extension_cb':
[path removed]/main/php_ini.c:350: undefined reference to `php_load_extension'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1


php-5.3.2-nolibdl-compile-error (last revision 2010-03-11 17:10 UTC by tsteiner at nerdclub dot net)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-03-19 16:42 UTC] richard at webdezign dot co dot uk
I have this problem too on CentOS 5.3.

I run:
../php-5.3.2/configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --target=x86_64-redhat-linux-gnu

and get the same error. I do have in my lib64 directory.

But if I apply the php-5.3.2-nolibdl-compile-error patch, does that mean that the PHP I compile will not be able to load extensions dynamically?
 [2010-06-08 14:54 UTC]
Automatic comment from SVN on behalf of tony2001
Log: fix bug #51276 (php_load_extension() is missing when HAVE_LIBDL is undefined)
 [2010-06-08 14:54 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: tony2001
 [2010-06-08 14:54 UTC]
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Oct 03 08:05:54 2022 UTC