|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33899 setting both extension_dir and extension= on command line doesn't work
Submitted: 2005-07-28 12:30 UTC Modified: 2005-07-29 15:25 UTC
From: Assigned:
Status: Closed Package: Dynamic loading
PHP Version: 5CVS-2005-07-28 (dev) OS: linux
Private report: No CVE-ID:
 [2005-07-28 12:30 UTC]
I try to test a newly created PECL extension, the extension shared object file has been created in ./modules/

when i do a "make install" to copy the to the default extension
directory first i can load it just fine using either "php -d ''"
or using dl(""); within my code

when i start php with "php -d 'extension_dir=./modules'" i can use 
dl(""); 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 '' 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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-28 12:32 UTC]
ext/standard/dl.c has the following code in php_dl():

		/* 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 ...
 [2005-07-29 15:25 UTC]
This bug has been fixed in CVS.

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-2015 The PHP Group
All rights reserved.
Last updated: Mon Nov 30 00:01:32 2015 UTC