Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
610 views
in Technique[技术] by (71.8m points)

post - PHP: Uploading large files fail

Im confused... I can't seem to upload files in the 2gb range. When i try using curl to send a 1.92gb file to my site (through an API), it doesn't report anything at all, its just blank. When i send a 1kb file, it reports back like it should.

When i try uploading via the upload form, it ends up freezing mid way, around 33%. Although im not sure if only the progress bar has froze or if the actual file upload it self has been suspended. I suspect that only the progress bar has froze because it still says data is being sent even though the progress bar freezes.

My php.ini (yes, its reflected by phpinfo as well):

register_globals = Off
magic_quotes_gpc = Off
post_max_size = 2047M
upload_max_filesize = 2047M
max_execution_time = 25200     ; Maximum execution time of each script, in seconds
max_input_time = 25200  ; Maximum amount of time each script may spend parsing request data
memory_limit = 2048M      ; Maximum amount of memory a script may consume (16MB)
short_open_tag = On 

My vps doesnt actually have 2gb of ram at its disposal, but does memory_limit really need to be set this high?

How should i go about testing this? I know 400mb files work, i haven't tested anything in between 400mb and 1.92gb

You will need a premium account to test up to 2gb, so here is one you can play with:

User: testreferral

Pass: 1234

http://filefx.com

I dont understand where this problem is arising.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Check for:

  1. Memory limit. Try uploading files above and below the actual memory limit.
  2. Time limit. Aren't your uploads take 7+ hours, are they?
  3. The effective settings. Some setting might be overridden by server/etc settings.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...