ID:               22427
 Comment by:       sbauer at gjl-network dot net
 Reported By:      jroland at uow dot edu dot au
 Status:           No Feedback
 Bug Type:         *General Issues
 Operating System: Windows XP / 2000
 PHP Version:      4.2.3
 New Comment:

While experiencing this issue, too we found that the cause of this
problem was the suhosin patch, wich was - by default - configured to
have a max limit for the length of cookie, request, post, get and
session vars. E.g. for POST this looks like:

suhosin.post.max_array_depth    100     100
suhosin.post.max_array_index_length     64      64
suhosin.post.max_name_length    64      64
suhosin.post.max_totalname_length       256     256
suhosin.post.max_value_length   65000   65000
suhosin.post.max_vars   200     200

Those derivatives needs to be set to a adequate higher number. E.g. in
our case, the problem was, that our POST data was too long (as this
seems to be the case for a lot of you here).

So I suggest to check your php.ini or (according to your distribution
there often is a suhosin.ini) and correct the above values or set them
to 0 to disable it. If those derivatives are not set, default values
will be used.
You need to check / add:
suhosin.post.max_....
suhosin.request.max_...
suhosin.get.max_...
suhosin.session.max_...
suhosin.cookie.max_...

Refer to your phpinfo() where these values should be listed!


Previous Comments:
------------------------------------------------------------------------

[2007-10-23 18:33:37] bcoy at chicagoreader dot com

It appears I miscounted the length of my data in the above comment. 
Here is a test script that proves the maximum length, at least on this
setup, is exactly 10,000 characters:

<html>
<body>

<p>
<?php
        echo "<strong>Request Length:</strong> " .
getenv("CONTENT_LENGTH") . "<br />";   
        echo "<strong>POST:</strong> "; print_r($_POST); echo "<br />";
  
        echo "<strong>HTTP_POST_VARS:</strong> ";
print_r($HTTP_POST_VARS);   
?>
</p>

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">

<textarea name="test" rows="50" cols="80"><?php
        for ($i = 0; $i < 10001; $i++) {
                echo 'a';
        }
?></textarea>

<input type="submit" />

</form>
</body>
</html>

------------------------------------------------------------------------

[2007-10-23 18:16:34] bcoy at chicagoreader dot com

This post exists to try and organize what I've read above.

There appear to be two main issues here.  The special character issue
in IE seems to be well understood at this point.  The fix is to to
translate all those characters into ascii (unicode html entities are
helpful here).

However, it appears that several people, including myself, still have a
length problem.  In my script, I have max_post_size set to 50M and
output_buffering on (as suggested in these comments).  I have an
all-ascii piece of data, which works up to 10021 characters, but fails
at 10022, regardless of what the last character is.  This fails in all
browsers: Safari, Firefox, and IE.  The data is not accessible via
$_POST or $HTTP_POST_VARS.  It fails with or without
enctype="multipart/form-data".  getenv("CONTENT_LENGTH") is 10173 in
Firefox and 10111 in Safari.  If I change to a GET request, I receive an
error indicating that the URI is too long for the server to support.

My setup is:
PHP 5.03
Apache 1.3.33
FreeBSD 4.10

------------------------------------------------------------------------

[2007-10-02 06:08:19] solidus_in at yahoo dot com

When the post data contains HTML special entities i.e. "&amp;" it is
stripped off. PHP POst variable only contains data before the first
occurrence of "&amp;"

I am not sure whether it is a bug or something else. I am yet to test
the POST containing other HTML entities. I have been trying to solve the
issue but it remains yet.

Any help there?

------------------------------------------------------------------------

[2007-09-21 08:48:04] umberto at meroni dot name

Hi there,
I solved this problem setting

output_buffering = On

in my PHP.ini.

I hope this helps.
Umberto Meroni

------------------------------------------------------------------------

[2007-09-18 11:57:57] idefix at dwaal dot net

The same problem happens to me (and my users unfortunately).

- PHP Version 5.1.6
- Apache/2.2.3 (CentOS)
- only with enctype="multipart/form-data"
- only with IE6 on WinXP sp2
- _POST is completely empty (count($_POST) === 0)
- Uploaded files are smaller than 3 MB.
- Charset: US-ASCII (both Apache header and Meta-tag)

For some reason only _some_ IE6 WinXP SP2 machines trigger this error.

Opera and Firefox do not seem to trigger this error at all.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/22427

-- 
Edit this bug report at http://bugs.php.net/?id=22427&edit=1

Reply via email to