Large file uploads disappear from server!
Moderator: General Moderators
Large file uploads disappear from server!
Hello,
I'm really stumped with this one:
Whenever we upload large files to the server, at some point during the upload the file php places in the /tmp directory disappears! The browser still thinks its uploading but when it finishes I get error 7 in the file upload array (I'm guessing it can't write move the file because it doesn't exist).
Everything works fine with small files so it's not permissions related, and my session file still exists in the tmp folder so I don't think the session is timing out.
Relevant PHP.ini settings are:
session.gc_maxlifetime 1440
session.cache_expire 1440
upload_max_filesize 2046M
post_max_size 2047M
memory_limit 2046M
Cheers,
Jonah
I'm really stumped with this one:
Whenever we upload large files to the server, at some point during the upload the file php places in the /tmp directory disappears! The browser still thinks its uploading but when it finishes I get error 7 in the file upload array (I'm guessing it can't write move the file because it doesn't exist).
Everything works fine with small files so it's not permissions related, and my session file still exists in the tmp folder so I don't think the session is timing out.
Relevant PHP.ini settings are:
session.gc_maxlifetime 1440
session.cache_expire 1440
upload_max_filesize 2046M
post_max_size 2047M
memory_limit 2046M
Cheers,
Jonah
Re: Large file uploads disappear from server!
Maybe this directive:
found in php.ini could help?
Code: Select all
max_input_time = 60 ; Maximum amount of time each script may spend parsing request dataThere are 10 types of people in this world, those who understand binary and those who don't
Re: Large file uploads disappear from server!
HI,
Thanks for the quick reply,
I actually forgot to put that in my first post, I have:
max_input_time -1
max_execution_time -1
Any other ideas?
Cheers,
Jonah
Thanks for the quick reply,
I actually forgot to put that in my first post, I have:
max_input_time -1
max_execution_time -1
Any other ideas?
Cheers,
Jonah
Re: Large file uploads disappear from server!
-1?
Hm, maybe some kind of users' space quota enabled on the server?The maximum execution time, in seconds. If set to zero, no time limit is imposed.
There are 10 types of people in this world, those who understand binary and those who don't
Re: Large file uploads disappear from server!
Ouch, that was lame of me,
Changing that now, will update in a few hours once the upload succeeds/fails.
In the mean time is there anything else you know of that may cause such behavior?
Thanks for the help,
Jonah
Changing that now, will update in a few hours once the upload succeeds/fails.
In the mean time is there anything else you know of that may cause such behavior?
Thanks for the help,
Jonah
Re: Large file uploads disappear from server!
The apache webserver has a LimitRequestBody configuration directive that restricts the size of all POST data regardless of the web scripting language in use. Some RPM installations sets limit request body to 512Kb. You will need to change this to a larger value or remove the entry altogether.
There are 10 types of people in this world, those who understand binary and those who don't
Re: Large file uploads disappear from server!
Ok,
I've changed the settings below and started a new upload @ 3:10 PST. Will try to watch and see if it times out after a particular amount of time, but so far it's been quite sporadic.
max_input_time 36000
max_execution_time 36000
Regards,
Jonah
I've changed the settings below and started a new upload @ 3:10 PST. Will try to watch and see if it times out after a particular amount of time, but so far it's been quite sporadic.
max_input_time 36000
max_execution_time 36000
Regards,
Jonah
Re: Large file uploads disappear from server!
OK,
I've looked into the LimitRequestBody and can't find it at all in my htaccess.conf file, but I'm using cPanel, which I'm not very familiar with, so it might be setting directives in other places. Is there a way I can check what LimitRequestBody is set to in PHP or in cPanel?
I did the following but came up with no results:
grep -r -i LimitRequestBody /usr/local/apache/conf
I am able to get 40MB files up so I'm guessing either the limit is set pretty high or not set at all (not set = around 2GB correct?)
Thanks,
Jonah
I've looked into the LimitRequestBody and can't find it at all in my htaccess.conf file, but I'm using cPanel, which I'm not very familiar with, so it might be setting directives in other places. Is there a way I can check what LimitRequestBody is set to in PHP or in cPanel?
I did the following but came up with no results:
grep -r -i LimitRequestBody /usr/local/apache/conf
I am able to get 40MB files up so I'm guessing either the limit is set pretty high or not set at all (not set = around 2GB correct?)
Thanks,
Jonah
Re: Large file uploads disappear from server!
No other ideas for now. Hope it'll work 
There are 10 types of people in this world, those who understand binary and those who don't
Re: Large file uploads disappear from server!
Ok, I got excited because I got a 500MB+ file up last night, but tried again and had the same thing happen -- file in tmp disappeared before the upload could complete.
It seems like something must be timing out for the server to decide the temp file is no longer bing used, but I have no clue as to what.
I suppose there could be something cleaning up files in the temp directory but what and why?
Still stumped....
It seems like something must be timing out for the server to decide the temp file is no longer bing used, but I have no clue as to what.
I suppose there could be something cleaning up files in the temp directory but what and why?
Still stumped....
Re: Large file uploads disappear from server!
I also noticed that there are session files in there from days ago. This, combined with the fact that our site does not get much traffic, leads me to think that the garbage cleanup hasn't even been running often enough to cause a problem..... 
Re: Large file uploads disappear from server!
1. Look at the Apache error log file.
2. Change the upload_tmp_dir parameter in php.ini to your own path ...
3. Also check what is run by cron and at daemons.
2. Change the upload_tmp_dir parameter in php.ini to your own path ...
3. Also check what is run by cron and at daemons.
There are 10 types of people in this world, those who understand binary and those who don't
Re: Large file uploads disappear from server!
1. nothing of note in the apache log
2. changed the upload tmp directory and i can now get large files up! (although i still don't know why they were disappearing from tmp >.< )
3. i only have one cron daemon set up to run an unrelated script nightly.
Thanks for your help, i guess its fixed
although not solved
2. changed the upload tmp directory and i can now get large files up! (although i still don't know why they were disappearing from tmp >.< )
3. i only have one cron daemon set up to run an unrelated script nightly.
Thanks for your help, i guess its fixed
although not solved
Re: Large file uploads disappear from server!
Glad to help
There are 10 types of people in this world, those who understand binary and those who don't
Re: Large file uploads disappear from server!
FYI I think I found the culprit:
For some reason the /tmp directory was mounted on a tiny partition (did cPanel do this?),
Anytway thanks again for all your help on this,
Jonah
For some reason the /tmp directory was mounted on a tiny partition (did cPanel do this?),
Anytway thanks again for all your help on this,
Jonah