php.net |  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: hartmut@php.net Assigned:
Status: Closed Package: Dynamic loading
PHP Version: 5CVS-2005-07-28 (dev) OS: linux
Private report: No CVE-ID: None
 [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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-28 12:32 UTC] hholzgra@php.net
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 ...
 [2005-07-29 15:25 UTC] sniper@php.net
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
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Nov 11 07:01:30 2024 UTC