Note: This could also fit in superuser.
I am setting up PHP 5.3.10 on a shared host with apache2 mpm itk and open_basedir in a way, that each user may not see o
Looking at the PHP source, sys_get_temp_dir() works with the following priority:
sys_temp_dir is checked in the ini configuration.TMP environment variable.TEMP environment variable.USERPROFILE environment variable.TMPDIR environment variable.P_tmpdir macro/tmp (according to the source, this is a last-ditch effort that should never happen).That should give you enough options for controlling the result of sys_get_temp_dir (e.g. ini_set('sys_temp_dir', $tmpPath) or putenv('TMPDIR=/foo/bar') as others mentioned) Unless it was previously calculated, in which case you're SOL as far as I know and the cached value will be used (but I have zero knowledge in PHP so would love to hear otherwise).