I run PHP as FCGI! I'm setting upload_tmp_dir
option as value /home/domain.com/tmp
. When executed phpinfo()
for double-check it's confirmed that the settings above are correct.
Nevertheless, when actual upload in happening, the uploading file is temporarily going to /tmp
directory with permissions apache:apache
and when the upload is fully finished only then the uploaded file is being moved to the destination directory, which was set in upload_tmp_dir
. After file is moved it has proper permissions which are domainowner:domainowner
.
What's happening with FCGI
as described above is absolutely wrong and different from what mod_php
or CGI
are doing! mod_php
and CGI
just start uploading a file directly to the upload_tmp_dir
and then just rename the file after upload is finished.
I have few considerable concerns about this as follows:
Imagine, what happens if 20 people, finish uploading a file that is around 2GB, right at the same time? Uploaded files will have to be moved to the home directory from /tmp
, creating a lot of useless load on file system! Thus, I thought that moving is much more resourceful rather than just renaming a file in the same directory?! Besides /tmp
is mounted as ext3
and home as ext4
and what is even worse that /tmp
partition is 16GB of space, which is total disaster from what I have imagined above?
Question:
How to force FCGI
to use upload_tmp_dir
directive the same way as CGI
or mod_php
? I haven't found a documented way to change the temp directory it uses.
Please help!?