Edit report at https://bugs.php.net/bug.php?id=64410&edit=1

 ID:                 64410
 Updated by:         a...@php.net
 Reported by:        md dot xytop at gmail dot com
 Summary:            sys_get_temp_dir() returns incorrect path
-Status:             Feedback
+Status:             Wont fix
 Type:               Bug
 Package:            Filesystem function related
 Operating System:   Windows 8
 PHP Version:        5.3.22
 Block user comment: N
 Private report:     N

 New Comment:

Ok, just tried it again with IIS+fastcgi+win8, it gives c:\windows\temp .

The windows implementation uses this API function to determine the temporary dir
http://msdn.microsoft.com/en-us/library/windows/desktop/aa364992(v=vs.85).aspx

According to that docs, c:\windows is the very last fallback when none of TMP, 
TEMP, USERPROFILE has worked. Conclusion - this is neither PHP nor Win API 
issue, 
but an environment one. For 5.4 one of those environment variables has to be 
set, 
for 5.5+ additionally sys_temp_dir is usable.


Previous Comments:
------------------------------------------------------------------------
[2013-07-08 18:57:13] czarek dot tomczak at gmail dot com

In the latest PHP 5.5.0 the temp directory on Windows 8 is "C:\Windows",
just confirmed by one of the users.

------------------------------------------------------------------------
[2013-07-06 13:55:26] czarek dot tomczak at gmail dot com

I can confirm this issue, using PHP 5.4.10 via CGI. Recently two 
users of the PHP Desktop project have reported problems with the 
temp directory on Windows 8:

https://code.google.com/p/phpdesktop/issues/detail?id=23
https://code.google.com/p/phpdesktop/issues/detail?id=39

In both cases the temp directory returned by sys_get_temp_dir() 
is "C:\Windows".

Seems like the php version doesn't matter, it happens on php 5.3,
5.4, 5.5.

------------------------------------------------------------------------
[2013-06-19 07:29:09] a...@php.net

Still experiencing this issue? Couldn't repro, it's always something like 
C:\Users\<user>\AppData\Local\Temp for me. Anything special in your setup?

------------------------------------------------------------------------
[2013-03-12 08:37:29] md dot xytop at gmail dot com

Description:
------------
On Windows8 function sys_get_temp_dir() returns path 'C:\Windows' which is of 
course not correct

Test script:
---------------
echo sys_get_temp_dir();
// output: C:\Windows



Expected result:
----------------
C:\Windows\Temp

Actual result:
--------------
C:\Windows


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64410&edit=1

Reply via email to