|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-07-28 12:30 UTC] hartmut@php.net
Description:
------------
I try to test a newly created PECL extension, the extension shared object file has been created in ./modules/myext.so
when i do a "make install" to copy the myext.so to the default extension
directory first i can load it just fine using either "php -d 'extension=myext.so'"
or using dl("myext.so"); within my code
when i start php with "php -d 'extension_dir=./modules'" i can use
dl("myext.so"); within my code just fine, too. the extension is loaded
from ./modules as expected
but when i try to use both commandline options
php -d 'extension_dir=./modules' -d 'extension=myext.so'
myext.so is either loaded from the default extension_dir,
not ./modules, or it is not loaded at all if not present in the
default extension dir
Expected result:
----------------
-d 'extension_dir=...' should take effect right away if given on the command line, even for following -d 'extension=...' options
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 11:00:02 2025 UTC |
ext/standard/dl.c has the following code in php_dl(): if (type==MODULE_PERSISTENT) { /* Use the configuration hash directly, the INI mechanism is not yet initialized */ if (cfg_get_string("extension_dir", &extension_dir)==FAILURE) { extension_dir = PHP_EXTENSION_DIR; } } else { extension_dir = PG(extension_dir); } extensions loaded from command line take the MODULE_PERSISTANT path but debug output shows that PG(extension_dir) shows the new extension_dir set by the command line option just fine ...