|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-05-30 01:46 UTC] asun at cobalt dot com
php doesn't set up its known_directives hash properly before reading
php.ini. as a result, php.ini doesn't set any values. this has the
effect of making things like document_root and extensions_dir not work.
here's a patch that changes the setup order and removes a circular
dependency in the known_directives initialization:
--- php-4.0.0/main.c.init Mon May 29 16:29:16 2000
+++ php-4.0.0/main.c Mon May 29 16:29:57 2000
@@ -890,12 +890,11 @@
FREE_MUTEX(gLock);
php_ini_mstartup();
+ REGISTER_INI_ENTRIES();
if (php_config_ini_startup() == FAILURE) {
return FAILURE;
}
-
- REGISTER_INI_ENTRIES();
zuv.short_tags = (zend_bool) PG(short_tags);
zuv.asp_tags = (zend_bool) PG(asp_tags);
--- php-4.0.0/php_ini.c.init Mon May 29 16:29:27 2000
+++ php-4.0.0/php_ini.c Mon May 29 16:29:49 2000
@@ -101,17 +101,6 @@
if (hashed_ini_entry->on_modify) {
hashed_ini_entry->on_modify(hashed_ini_entry, hashed_ini_entry->value, hashed_ini_entry->value_length, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, PHP_INI_STAGE_STARTUP);
}
- if ((default_value=cfg_get_entry(p->name, p->name_length))) {
- if (!hashed_ini_entry->on_modify
- || hashed_ini_entry->on_modify(hashed_ini_entry, default_value->value.str.val, default_value->value.str.len, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, PHP_INI_STAGE_STARTUP)==SUCCESS) {
- hashed_ini_entry->value = default_value->value.str.val;
- hashed_ini_entry->value_length = default_value->value.str.len;
- }
- } else {
- if (hashed_ini_entry->on_modify) {
- hashed_ini_entry->on_modify(hashed_ini_entry, hashed_ini_entry->value, hashed_ini_entry->value_length, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, PHP_INI_STAGE_STARTUP);
- }
- }
hashed_ini_entry->modified = 0;
p++;
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 15:00:01 2025 UTC |
some more clarification: because modules are loaded in the config file parsing stage, the lack of extensions_dir was causing problems. the previous patch had too many side effects and looked like it was going to take too much trouble to get right. as module loading is the only thing that needs real values, here's a simpler patch that just deals with that case: --- php-4.0.0/ext/standard/dl.c.init Mon May 29 21:21:32 2000 +++ php-4.0.0/ext/standard/dl.c Mon May 29 21:26:21 2000 @@ -78,18 +78,22 @@ void php_dl(pval *file,int type,pval *return_value) { void *handle; - char *libpath; + char *libpath, *extension_dir; zend_module_entry *module_entry,*tmp; zend_module_entry *(*get_module)(void); PLS_FETCH(); ELS_FETCH(); - if (PG(extension_dir) && PG(extension_dir)[0]){ - int extension_dir_len = strlen(PG(extension_dir)); + if (PG(extension_dir)) + extension_dir = PG(extension_dir); + else + cfg_get_string("extension_dir", &extension_dir); + if (extension_dir && extension_dir[0]) { + int extension_dir_len = strlen(extension_dir); libpath = emalloc(extension_dir_len+file->value.str.len+2); - sprintf(libpath,"%s/%s",PG(extension_dir),file->value.str.val); + sprintf(libpath,"%s/%s",extension_dir,file->value.str.val); } else { libpath = estrndup(file->value.str.val, file->value.str.len); }