Or rather, is there anyway to set the system temp directory (NOT the upload temp directory) in PHP?
When I run
echo sys_get_temp_dir();
I get /tmp
.
When I run
ini_get('upload_tmp_dir');
I get the directory that I specified in my php.ini
file. Is there anyway to change what PHP uses for the sys temp dir?
I keep having random files show up in my /tmp
directory. These are prefixed by "php" and then have a series of random numbers and letters. From what I can tell, these are probably being generated by PHP tmpfile or tempnam. httpd is the process that is using them when they are created. They are massive files that fill up my entire /tmp
partition and take my server down. I can't figure out where they are coming from. I could increase the /tmp
partition size from 500MB to 2GB but I'd rather avoid that if I can.
I don't understand where the sys_get_temp_dir()
is pulling /tmp
from. Everything I search for just tells me to change the upload_tmp_dir in .ini but these are two separate things.