PHP 4.0 Bug #4683: php doesn't initialize itself properly
| From: | asun at cobalt dot com | Date: | Mon, 29 May 2000 23:46:14 +0000 |
| Subject: | PHP 4.0 Bug #4683: php doesn't initialize itself properly | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-19717@lists.php.net to get a copy of this message | ||
From: asun@cobalt.com
Operating system: linux 2.2.14
PHP version: 4.0.0 Release
PHP Bug Type: Other
Bug description: php doesn't initialize itself properly
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++;
}