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
Running a putenv('TMPDIR=/foo/bar')
inside PHP seems to be able to affect the result of sys_get_temp_dir()
. You could have an auto_prepend_file
directive arranged to run a piece of PHP to set up the TMPDIR
and avoid messing with a redefinition of sys_get_temp_dir()
.
Edit: Also, you could easily use putenv('TMPDIR='.ini_get('open_basedir').'/tmp')
to set the temporary directory to the directory structure you laid out in the question.
Funny enough, this turns out to also work (given that you keep the SetEnv TMPDIR /foo/bar
in your Apache configuration):
putenv('TMPDIR='.getenv('TMPDIR'));
Seems like a no-op, but actually does have effect on sys_get_temp_dir()
. I'm starting to suspect this has to be some environment-handling bug in PHP.