how modify php.ini to upload 10G files

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
hideeho
Forum Newbie
Posts: 4
Joined: Thu Feb 05, 2009 12:55 pm

how modify php.ini to upload 10G files

Post by hideeho »

Hello,

How do I modify php.ini to allow 10G file uploads?
I'm getting this error:
PHP Warning: Unknown: POST Content-Length of 205 bytes exceeds the limit of -2147483648 bytes in Unknown on line 0, referer: http ...

Here's what I've tried in php.ini
max_execution_time = 3000
max_input_time = 60

; To upload large files, this value must be larger than upload_max_filesize.
; Generally speaking, memory_limit should be larger than post_max_size .
; (21 Jun 2008) Setting post_max_size to a value of 6144M or greater causes error
post_max_size = 8M ; no err msg
;post_max_size = 20G - get exceeds err msg
;post_max_size = 6G - get exceeds err msg

upload_max_filesize = 10G
memory_limit = -1

This is on Solaris 10, Apache 2.2.11, PHP 5.2.8

Please help! Need to get this working for client today!
Thank you!
User avatar
Benjamin
Site Administrator
Posts: 6934
Joined: Sun May 19, 2002 10:24 pm

Re: how modify php.ini to upload 10G files

Post by Benjamin »

Not going to happen buddy.
hideeho
Forum Newbie
Posts: 4
Joined: Thu Feb 05, 2009 12:55 pm

Re: how modify php.ini to upload 10G files

Post by hideeho »

uhh!!
What's the limiting factor?
What's the max upload allowed?
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: how modify php.ini to upload 10G files

Post by VladSun »

post_max_size integer
Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize. If memory limit is enabled by your configure script, memory_limit also affects file uploading. Generally speaking, memory_limit should be larger than post_max_size . When an integer is used, the value is measured in bytes.
memory_limit integer

This sets the maximum amount of memory in bytes that a script is allowed to allocate. This helps prevent poorly written scripts for eating up all available memory on a server. Note that to have no memory limit, set this directive to -1.

It looks like you'll need 10Gigs of RAM available just for your script, though I'm not sure it's true.
There are 10 types of people in this world, those who understand binary and those who don't
hideeho
Forum Newbie
Posts: 4
Joined: Thu Feb 05, 2009 12:55 pm

Re: how modify php.ini to upload 10G files

Post by hideeho »

Hmm, yes, appears so.
I didn't know memory_limit's max, so I set it to "-1"
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: how modify php.ini to upload 10G files

Post by John Cartwright »

Your upload speed is probably much slower than your download speed, meaning it will take a seriously long time to complete the upload. Uploading a single 10GB file is just not practical. Typically, large files are chunked into 100mb rar's and re-assembled later.
hideeho
Forum Newbie
Posts: 4
Joined: Thu Feb 05, 2009 12:55 pm

Re: how modify php.ini to upload 10G files

Post by hideeho »

Hmm, good point.

I did some variations of the post_max_size syntax to find which ones caused the "Unknown: POST Content-Length" error :
;post_max_size = 8M - good
;post_max_size = 1.9G - good
post_max_size = 20000000000 ; good
;post_max_size = 15000M; - err
;post_max_size = 10000M ; good
;post_max_size = 20000M ; err
;post_max_size = 2000M - good
;post_max_size = 1G - good
;post_max_size = 2G - err
;post_max_size = 20G - err
;post_max_size = 6G - err

Hmm, why would the syntax of the bytes make a diff?

Tomorrow, I'll have the client test a file upload to see if it'll actually work.
msbhvn
Forum Newbie
Posts: 1
Joined: Thu Mar 11, 2010 12:50 pm

Re: how modify php.ini to upload 10G files

Post by msbhvn »

Looks like you cannot go beyond 2GB as it's being stored as a signed 32 bit int.

See: http://bugs.php.net/35578
and
http://php.net/manual/en/ini.core.php (post_max_size)
Post Reply