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

 ID:                 54710
 Updated by:         il...@php.net
 Reported by:        royanee at yahoo dot com
 Summary:            sys_get_temp_dir() does not respect upload_tmp_dir
-Status:             Open
+Status:             Bogus
 Type:               Bug
 Package:            PHP options/info functions
 PHP Version:        5.3.6
 Block user comment: N
 Private report:     N

 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

The function is designed to return the location of the temporary
directory, not 

the file upload directory.


Previous Comments:
------------------------------------------------------------------------
[2011-05-11 15:47:13] royanee at yahoo dot com

Additionally, enabling open_basedir results in FALSE and triggers the
following warning:



PHP Warning:  tempnam(): open_basedir restriction in effect. File(/tmp)
is not within the allowed path(s): (/www/myvhost/)

------------------------------------------------------------------------
[2011-05-11 15:45:07] royanee at yahoo dot com

Description:
------------
The only configuration option for setting the temporary directory for
normal operations is the upload_tmp_dir option. As such, functions that
rely on the temporary directory should respect the upload_tmp_dir option
to ensure that true separation of concerns between virtual hosts can be
achieved. This is particularly important when also using open_basedir.



Note that the following line is correctly located in the vhost config:



php_admin_value upload_tmp_dir "/www/myvhost/tmp"

Test script:
---------------
<?php

// Create a temporary file in the temporary 

// files directory using sys_get_temp_dir()

$temp_file = tempnam(sys_get_temp_dir(), 'Tux');



echo $temp_file;

?>

Expected result:
----------------
/www/myvhost/tmp/TuxDRhRIg

Actual result:
--------------
/tmp/TuxDRhRIg


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



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

Reply via email to