Page 1 of 1
how modify php.ini to upload 10G files
Posted: Thu Feb 05, 2009 1:04 pm
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!
Re: how modify php.ini to upload 10G files
Posted: Thu Feb 05, 2009 1:18 pm
by Benjamin
Not going to happen buddy.
Re: how modify php.ini to upload 10G files
Posted: Thu Feb 05, 2009 1:23 pm
by hideeho
uhh!!
What's the limiting factor?
What's the max upload allowed?
Re: how modify php.ini to upload 10G files
Posted: Thu Feb 05, 2009 5:34 pm
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.
Re: how modify php.ini to upload 10G files
Posted: Thu Feb 05, 2009 6:14 pm
by hideeho
Hmm, yes, appears so.
I didn't know memory_limit's max, so I set it to "-1"
Re: how modify php.ini to upload 10G files
Posted: Thu Feb 05, 2009 7:14 pm
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.
Re: how modify php.ini to upload 10G files
Posted: Thu Feb 05, 2009 10:39 pm
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.
Re: how modify php.ini to upload 10G files
Posted: Thu Mar 11, 2010 12:52 pm
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)