From:             lvdgraaff at gmail dot com
Operating system: Mac OS 10.5.3
PHP version:      5.2.6
PHP Bug Type:     Filesystem function related
Bug description:  putenv("TMPDIR=... doens't always sets the TMPDIR

Description:
------------
Due to a bug with the ftp_*list functions I had to set the TMPDIR
manually.
[http://bugs.php.net/bug.php?id=28865]

But, to my surprise, this doesn't ALWAYS work correctly. I'll demonstrate
it with the function sys_get_temp_dir and tmpfile.

Details:
If the putenv fails, than it doesn't work to direct try it again. I really
have to wait for a few seconds, before a retry will be succesfull. When it
works again, it does it for a few minutes.

I use PHP 5.2.5, but I saw no issues in the changelog witch seem to be
related to this.

Reproduce code:
---------------
<?
putenv("TMPDIR=/Users/lvdgraaff/Web/www/compile/tmp");

echo "GET ENV: \t" . getenv("TMPDIR") . "\n";
echo "SGTD: \t\t" . sys_get_temp_dir() . "\n";
print_r(tmpfile());

NOTE: this was the only code in the whole file

Expected result:
----------------
GET ENV:        /Users/lvdgraaff/Web/www/compile/tmp
SGTD:           /Users/lvdgraaff/Web/www/compile/tmp
Resource id #2

NOTE: I get this, most of the time, but not ALL the time.


Actual result:
--------------
GET ENV:        /Users/lvdgraaff/Web/www/compile/tmp
SGTD:           /var/folders/4T/4TDJmSQYGV04rPNp5PKZ2++++TI/-Tmp-/

(note: no resource, but an empty line!)

SOMETIMES I get this result.

-- 
Edit bug report at http://bugs.php.net/?id=45435&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=45435&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=45435&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=45435&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=45435&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=45435&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=45435&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=45435&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=45435&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=45435&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=45435&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=45435&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=45435&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=45435&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=45435&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=45435&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=45435&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=45435&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=45435&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=45435&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=45435&r=mysqlcfg

Reply via email to