Re: [PHP-I18N] Re: What's the scope of putenv()?

[email protected] (Karen Andrien)
Newsgroups php.i18n
Message-ID <[email protected]>
Thanks all for your help!

By using a putenv() call to the new timezone at the head of my script,
and a second putenv() call to my own timezone at the end, I've had no
troubles of any kind.  The script runs perfectly in the new timezone
without affecting any simultaneous PHP scripts, any future PHP scripts,
or any present or future Apache requests.

I still don't know whether the second putenv() call is necessary, but
it certainly does no harm.  Possibly it's required on a multi-threaded
server, but not on a multi-process server?  If nothing else, it serves
to remind the programmer to clean up her variables, release her unused
objects, and practise similar good habits.

-Karen


Rasmus Lerdorf wrote:
> Assuming you are running a multi-process web server like Apache1 or
> Apache2 with the prefork mpm, then there is no problem.  
>
>> several users on the documentation page [...] claim
>> that putenv() has changed the time zone for both the current
>> request and other future requests at random.
> 
> They are either wrong, or they are using a multithreaded server like
> IIS.



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.