|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-09-12 16:45 UTC] kalowsky@php.net
[2007-09-13 10:12 UTC] jani@php.net
[2007-09-13 10:12 UTC] jani@php.net
[2007-09-13 15:50 UTC] kalowsky@php.net
[2007-09-18 09:25 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 12:00:01 2025 UTC |
Description: ------------ Some PHP extensions expect to have symbols from other PHP extensions available. This is the case for PDO drivers (which use symbols from PDO extension) and XSL (which uses symbols from DOM extension). Extensions are loaded with dlopen(..., RTLD_GLOBAL) on platforms with dlopen() (i.e. most unices). On Mac OS X, NSLinkModule() is used instead of dlopen(), but with 'private' option, which hides symbols of dynamically loaded extensions from other dynamically loaded code. Due to this symbol hiding, PDO and DOM needed to be compiled into base PHP binary, otherwise the dependant extension couldn't be dynamically loaded since expected symbols are not found. PDO configure script even intentionally silently disables compilation of dynamically loaded PDO module on MacOSX/Darwin because of this. Following patch makes it possible to load also PDO and DOM dynamically on Mac OS X and thus PHP extensions work all the same way as on other UNIX systems: --- Zend/zend_extensions.c.orig 2007-09-11 22:00:50.000000000 +0200 +++ Zend/zend_extensions.c @@ -243,7 +243,7 @@ void *zend_mh_bundle_load(char* bundle_p return NULL; } - bundle_handle = NSLinkModule(bundle_image, bundle_path, NSLINKMODULE_OPTION_PRIVATE); + bundle_handle = NSLinkModule(bundle_image, bundle_path, NSLINKMODULE_OPTION_NONE); NSDestroyObjectFileImage(bundle_image); /* call the init function of the bundle */ Reproduce code: --------------- Compile PDO (after fix to configure script) as dynamic extensions, as well as pdo_mysq, and add into php.ini lines: extension=pdo.so extension=pdo_mysql.so then run: php -m | grep -i pdo Expected result: ---------------- PDO pdo_mysql Actual result: -------------- dyld: lazy symbol binding failed: Symbol not found: _php_pdo_declare_long_constant Referenced from: /Users/Shared/pkg/lib/php/20040412/pdo_mysql.so Expected in: flat namespace dyld: Symbol not found: _php_pdo_declare_long_constant Referenced from: /Users/Shared/pkg/lib/php/20040412/pdo_mysql.so Expected in: flat namespace Trace/BPT trap