#37908 [NEW]: putenv() variables not reset at the end of the script
| From: | php at raj dot homelinux dot com | Date: | Sun, 25 Jun 2006 12:56:24 +0000 |
| Subject: | #37908 [NEW]: putenv() variables not reset at the end of the script | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-98751@lists.php.net to get a copy of this message | ||
From: php at raj dot homelinux dot com
Operating system: Linux 2.6
PHP version: 4.4.2
PHP Bug Type: Apache2 related
Bug description: putenv() variables not reset at the end of the script
Description:
------------
putenv() claims that the env variables are reset to their original values
when the script exits. HOwever, this doesn't seem to be happening - as a
result, if the env var TZ is set from a php script, it affects apache2
logs, changing the timestamp for all subsequent gets served by the process
that ran this php script which set TZ.
Reproduce code:
---------------
set $timezone different from server timezone and run:
putenv("TZ=".$timeZone);
--
then do a few more gets and check the apache logs, you will see something
like:
xx.xx.xx.xx - - [19/Jun/2006:23:05:18 -0400] "GET ..."
xx.xx.xx.xx - - [19/Jun/2006:23:05:18 -0400] "GET ..."
xx.xx.xx.xx - - [20/Jun/2006:13:05:11 +1000] "GET ..."
(see how the timestamp in the apache log flipped from -0400 to +1000..
thats the problem)
Expected result:
----------------
Timestamps should remain consistent
Actual result:
--------------
Timestamps are not consistent (see example above)
--
Edit bug report at http://bugs.php.net/?id=37908&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37908&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=37908&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37908&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=37908&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=37908&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=37908&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=37908&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=37908&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=37908&r=support
Expected behavior: http://bugs.php.net/fix.php?id=37908&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=37908&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=37908&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=37908&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37908&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=37908&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=37908&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=37908&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=37908&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=37908&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=37908&r=mysqlcfg