Re: php.ini under Windows

From: Date: Fri, 24 Mar 2000 10:01:03 +0000
Subject: Re: php.ini under Windows
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-17194@lists.php.net to get a copy of this message
Just to make my previous letter a bit clearer; The ini implementation in PHP 4.0 is a couple of lightyears ahead of that in PHP 3.0. In PHP 3, you couldn't really know what the active values were for each and every INI directive; At best, you could know what the php.ini value was for a given directive, using get_cfg_var(), but it didn't necessarily reflect the actual active value for that directive, since php.ini directives could be overriden by .htaccess files or specialized functions. In PHP 4, the underlying code changed completely. get_cfg_var() should only interest you if you're actually interested in the value that's inside the php.ini file, and not necessarily the active value (I can't imagine why you'd want to do it usually, but you can still use get_cfg_var()). If you want the actual value, you can use ini_get(), and better, you can change it using ini_set(), and restore it using ini_restore() (restoring goes back to the original value, without taking into account any .htaccess/registry/whatever directives). Bottom line is that in PHP 4, php.ini is just one source for INI information, which isn't any more or less important than any other sources (currently they're Apache conf files and Win32 registry). Zeev On Fri, 24 Mar 2000, Faisal Nasim wrote: > : Zeev Suraski wrote: > : > > : > For historical reasons (in other words, I have no idea why it's like > : > that), under Windows, PHP will refuse to start up if it doesn't find the > : > php.ini file. Especially under ISAPI when this error cannot be conveyed > : > to the user, this can be quite problematic. > : > Does anyone see the point in this behavior? I want to change it so that > : > PHP will happily start up under Windows, regardless of the availability > of > : > the php.ini file, like it does under other platforms. > : > : > : Given the current implementation (which we already said we'll change in > the > : future, and I'm planing on giving it a look sometime during the next month > : or so), I personaly think it is a bad idea. > : Remember : if no php.ini file is parsed, configuration_hash is empty, so > : get_cfg_var() always returns an empty string, and that's _very_ confusing. > > How about a default value, as in the standard php.ini? > > blah = get_from_phpini ( "max_execution_time" ) || 30; > > Where 30 is the default execution time in php.ini. > > and blah goes into the configuration_hash, thus get_cfg_var() > works as it does now. > > Any drawbacks or something? > > > Faisal > > > > -- Zeev Suraski <zeev@zend.com> http://www.zend.com/

« previous php.dev (#17194) next »