Planet Ubuntu -
22 hours and 20 minutes ago
img class=face src=http://planet.ubuntu.com/heads/sh.png alt= pOh well, I think I'm using lazyweb
too often now, but as I don't find a solution, and some of you are mostly smarter then I am, here
the question:/p pSetup an Apache2.2 webserver with PHP5 and configure /etc/php5/apache2/php.ini to
allow fileuploads with/p ppost_max_size gt; 6G and upload_max_filesize gt; 4G/p pNow, given that
apache2 has the a target=_blank
href=http://httpd.apache.org/docs/2.2/mod/core.html#limitrequestbodyLimitRequestBody set to 0
/athis should give us the possibility to upload files via multipart/formdata and post method which
are bigger then 2G./p pBut, somehow we are running into a target=_blank
href=http://bugs.php.net/bug.php?id=44522PHP.NET Bug #44522/a and the upload stops somehow./p
pYesterday I was hunting for a fix of this. I came to the conclusion, that the internal variables
which are used for post_max_size and upload_max_filesize are already quot;longquot; types, but in
rfc1867.c there is one occasion of max_file_size which is quot;intquot; type. Regarding x86 and
x86_64 architecture, I thought: quot;hmmm..this won't workquot; so I created a patch for our hardy
and intrepid version:/p pre class=rteindent2 Index: php5-5.2.6/main/rfc1867.c
=================================================================== ---
php5-5.2.6.orig/main/rfc1867.cnbsp;nbsp;nbsp;nbsp;nbsp; 2008-12-01 13:52:11.990002311 +0000 +++
php5-5.2.6/main/rfc1867.cnbsp;nbsp; 2008-12-01 13:52:25.980001508 +0000 @@ -782,7 +782,8 @@
nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; char *boundary, *s=NULL, *boundary_end = NULL, *start_arr=NULL,
*array_index=NULL; nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; char *temp_filename=NULL, *lbuf=NULL,
*abuf=NULL; nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; int boundary_len=0, total_bytes=0, cancel_upload=0,
is_arr_upload=0, array_len=0; -nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; int max_file_size=0, skip_upload=0,
anonindex=0, is_anonymous; +nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; long max_file_size=0;
+nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; int skip_upload=0, anonindex=0, is_anonymous;
nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; zval *http_post_files=NULL; HashTable *uploaded_files=NULL;
nbsp;#if HAVE_MBSTRING amp;amp; !defined(COMPILE_DL_MBSTRING) nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;
int str_len = 0, num_vars = 0, num_vars_max = 2*10, *len_list = NULL;/prepre class=rteindent2
/prepBut somehow this wasn't working...or our intrepid php5 version is totally borked (which I
don't think), so most likely I'm the one who fcked up./p pNow I'm thinking about something else.
Regarding the documentation of Apache2 the LimitRequestBody size it says that it can hold a value
between 0 (unlimited request body size) and 2147483647 (2GB request body size)./p pCould it be,
that Apache2 is the bugger, and won't let me upload files gt; 2GB filesize?/p pIf you have any
clue, just comment or write an email to me with the subject quot;I found the solutionquot;. If you
are near Karlsruhe, you are also able to win a pint of beer :)/p pnbsp;/p

|