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

 ID:                 44972
 Comment by:         brian at macserve dot net
 Reported by:        timtowdi at yahoo dot com
 Summary:            Feature Request: overriding sys_get_tmp_dir
 Status:             Open
 Type:               Feature/Change Request
 Package:            Feature/Change Request
 Operating System:   FreeBSD
 PHP Version:        5.2.6
 Block user comment: N

 New Comment:

1. the suggested php.ini setting for "uploaded files" has ZERO effect on
the original requestors report. the directory returned by the
sys_get_tmp_dir() function cannot be overriden from within PHP or
php.ini; only where uploaded files are placed can be overridden which
only coincidentally is the same when you do NOT define upload_tmp_dir in
php.ini.



the original request stands as a valid critique.





2. your url is missing an "el" at the end of manual.

corrected:

http://www.php.net/manual/en/ini.core.php#ini.upload-tmp-dir





3. The security environment of the original request is interesting and
perhaps up for debate, but is not relevant to this discussion.



There may be valid technical reasons for locating TMPDIR for PHP to
another location other than the TMPDIR environment variable that comes
into Apache. Perhaps temp files for PHP need to live on a different disk
for performance and/or security reasons.



Being able to define this with a php.ini setting is completely
reasonable.





4. Sorry to be a noodge, but this request over 2 years old and not
resolved?



./main/php_open_temporary_file.c : php_get_temporary_directory() needs
just a little bit of code it looks like.



Thanks!


Previous Comments:
------------------------------------------------------------------------
[2008-05-12 15:46:49] paj...@php.net

One is already possible:



http://www.php.net/manua/en/ini.core.php#ini.upload-tmp-dir



About the temp directory, you will have to teach your ISP how to
configure php correctly. Not having the tmp dir in the open_basedir
lists (and having only one global tmp dir instead of per user) is so
wrong.



However a temp_dir ini setting (settable per vhost) would be nice. Let
see what's the other say (I'm not a fan of ENV variables ;).

------------------------------------------------------------------------
[2008-05-12 15:30:47] timtowdi at yahoo dot com

Description:
------------
On a server with open_basedir in effect, sys_get_temp_dir() still uses
the default TMPDIR environment variable (which in this case is '/tmp'). 
This effectively renders sys_get_temp_dir useless for me, and there is
no way to override it.



It would be EXTREMELY useful to be able to set the default temp
directory from an ini directive, such as the session temp dir and the
uploaded files temp dir.



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



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

Reply via email to