ID:               49983
 User updated by:  dgrace at wingsnw dot com
 Reported By:      dgrace at wingsnw dot com
-Status:           Feedback
+Status:           Closed
 Bug Type:         *General Issues
 Operating System: Debian Linux
 PHP Version:      5.2.11
 New Comment:

Closing this myself -- I found the cause.

Debian's PHP packages include the Suhosin patch
(http://www.hardened-php.net/suhosin/) which, among other features, adds
a configuration option for suhosin.post.max_vars.  I didn't see a
relevant option in php.ini, but it shows on phpinfo();


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

[2009-10-24 20:51:22] [email protected]

Obviously it's some misconfiguration / limitation of your server
setup:
"$_POST contained 10001 out of 10000 variable(s)"

You should check your error logs, php.ini for post_max_size and
especially the webserver setting you use. I tried with lighttpd + PHP
(FastCGI) and had no problems. 



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

[2009-10-24 01:51:51] dgrace at wingsnw dot com

Description:
------------
PHP will quietly discard variables POSTed to a form after the 1000th
posted variable.  This value seems to be consistent and is not affected
by post_max_size.

I've searched the documentation about php.ini directives and could not
find anything suggesting this limit can be changed.

This is especially problematic if presenting a list of items to be
selected by the user (i.e. listing 1000+ items with an option to delete
the selected items).  The discard occurs regardless of the POST variable
names -- i.e. if they are all named "id[]" to convert to an array, the
failure will still happen.

Tested with both IE7 and FF3.5.3 to confirm that it was not a browser
limitation.

Tested on Apache/2.2.13 (Debian) 

Reproduce code:
---------------
<?php
/* Test case for bug report: See how many POST variables make it back
to PHP. */
error_reporting(E_ALL);

$numvars = 10000;
echo '<html><body>';

echo '<p>$_POST contained ', ((int) @count($_POST)), ' out of ',
$numvars, ' variable(s)</p>';

echo "<form action=\"?\" method=\"post\">";
for($n = 0 ; $n < $numvars; ++$n) { echo '<input type="hidden"
name="v', $n, '" value="0" />'; }
echo '<input type="submit" name="submit" value="Run Test" />';
echo '</form>';
echo '</body></html>';


Expected result:
----------------
After submitting the form once, 10001 out of 10000 variables (since the
submit button itself is an additional _POST variable, the count would be
off in this case)

Actual result:
--------------
1000 of 10000 variables


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


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

Reply via email to