Page 1 of 1
Large file uploads disappear from server!
Posted: Wed May 14, 2008 2:51 pm
by jonah79
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
Re: Large file uploads disappear from server!
Posted: Wed May 14, 2008 3:11 pm
by VladSun
Maybe this directive:
Code: Select all
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
found in php.ini could help?
Re: Large file uploads disappear from server!
Posted: Wed May 14, 2008 4:35 pm
by jonah79
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
Re: Large file uploads disappear from server!
Posted: Wed May 14, 2008 5:02 pm
by VladSun
-1?
The maximum execution time, in seconds. If set to zero, no time limit is imposed.
Hm, maybe some kind of users' space quota enabled on the server?
Re: Large file uploads disappear from server!
Posted: Wed May 14, 2008 5:06 pm
by jonah79
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
Re: Large file uploads disappear from server!
Posted: Wed May 14, 2008 5:07 pm
by VladSun
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.
Re: Large file uploads disappear from server!
Posted: Wed May 14, 2008 5:11 pm
by jonah79
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
Re: Large file uploads disappear from server!
Posted: Wed May 14, 2008 5:31 pm
by jonah79
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
Re: Large file uploads disappear from server!
Posted: Wed May 14, 2008 5:38 pm
by VladSun
No other ideas for now. Hope it'll work

Re: Large file uploads disappear from server!
Posted: Thu May 15, 2008 12:45 pm
by jonah79
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....
Re: Large file uploads disappear from server!
Posted: Thu May 15, 2008 1:30 pm
by jonah79
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!
Posted: Thu May 15, 2008 3:13 pm
by VladSun
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.
Re: Large file uploads disappear from server!
Posted: Fri May 16, 2008 12:42 pm
by jonah79
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

Re: Large file uploads disappear from server!
Posted: Fri May 16, 2008 2:56 pm
by VladSun

Glad to help

Re: Large file uploads disappear from server!
Posted: Fri May 16, 2008 4:19 pm
by jonah79
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