RE: [PHP-DEV] 5.2.4RC1 Released
| From: | Uwe Schindler | Date: | Fri, 03 Aug 2007 12:04:23 +0000 |
| Subject: | RE: [PHP-DEV] 5.2.4RC1 Released | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-31417@lists.php.net to get a copy of this message | ||
> On 03.08.2007 14:48, Uwe Schindler wrote:
> >> How EXACTLY does the web-server put the value?
> >> To me it looks like you're using some global config file, so no wonder
> >> it's put globally.
> >
> > It is not global. The overwritten value is set only for a specific path
> (you
> > can be sure that I know how Sun Webserver works, I maintain the NSAPI
> > module... :-) ).
> >
> > The changed value then corrupts the ini entry complete. I found out why
> this
> > is so, so this is a _bug_.
> >
> > The following patch, when reverted fixes it and restores the old
> behaviour:
> >
> >
> ÑïzvÖê?d œW
> ö&>http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_ini.c?r1=1.39.2.2.2.8&r2=1.
> 39
> > .2.2.2.9&pathrev=PHP_5_2
>
> It's done to prevent overwriting settings set in httpd.conf (aka
> php_admin_value's).
I know how this is meant. But without the added patch, it does not corrupt
error_reporting. The problem is that your patch is not compatible to a
webserver that runs more than one request per process (a multithreaded one),
because it modifies the ini setting in a way that affects later running
threads.
I try to find a way to reproduce it in other webservers.
This is the code that NSAPI uses to modify the INI entries:
entry->param->name is the nullterminated ini key name, entry->param->value
is the nullteminated value. This code runs on every request (like in apache
a php_(admin)_value) that needs to set some specific ini-values. The server
runs only *one* process that handles all requests in its lifetime because it
is multithreaded:
if (zend_alter_ini_entry(entry->param->name, strlen(entry->param->name)+1,
entry->param->value, strlen(entry->param->value),
PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE)==FAILURE) {
log_error(LOG_WARN, pblock_findval("fn", NSG(pb)), NSG(sn), NSG(rq),
"Cannot change php.ini key \"%s\" to \"%s\"",
entry->param->name,
entry->param->value);
}
. It is always runned with admin "privileges" because SJSWS does not have
htaccess files. The big advantage to have the possibility to set ini values
is, that it is not server-wide you can change the call to PHP SAPI e.g. per
virtual server or URI path (see documentation of NSAPI).
Uwe