3

I was running approximately PHP Version 5.3.5. I wanted to enable SOAP, and upgraded to PHP Version 5.3.13 using webtatic repo. Everything is working great! Except...

I POST some an array using Ajax. The full array is posted by the client, but it appears the server only receives the first 1,000 elements of the array.

I looked into php.ini, and can't see any limit.

Please advise.

user1032531
  • 24,767
  • 68
  • 217
  • 387
  • 1
    Most probably you hit a limit in PHP, see http://stackoverflow.com/questions/9673895/php-warning-unknown-input-variables-exceeded-1000 (if so, there should be a warnign in your logs) – Stephan B Jun 14 '12 at 11:43
  • Feel kind of silly. Can't find the error log. Currently, I am not in production, and just display them. – user1032531 Jun 14 '12 at 12:00
  • When using Apache, check the main error_log - you might need root access on linux. Other than that, try to increase the config setting from the linked answer. – Stephan B Jun 14 '12 at 12:09
  • I had been looking into /var/log/httpd/error.log. It is huge! I changed the name and made a new blank one, but am doing something wrong since Apache isn't updating it. – user1032531 Jun 14 '12 at 12:12
  • Quite off-topic, but apache only writes to the new log after restarting. To see the end of the file, use `tail /var/log/httpd/error.log` ; ) – Stephan B Jun 14 '12 at 12:15
  • Yep, figured out tail. And found Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. just as you suggested! – user1032531 Jun 14 '12 at 12:18
  • Thank you! max_input_vars=4000 – user1032531 Jun 14 '12 at 12:24
  • Please add an answer stating to change max_input_vars so I my select it as being the right answer. Thanks – user1032531 Jun 14 '12 at 12:30

4 Answers4

4

I flagged this as a duplicate of PHP Warning: Unknown: Input variables exceeded 1000 but the OP there had a different problem. Thus here the solution from the comments:

When PHP 5.3.9+ returns exactly 1000 variables and / or array elements, you run into security limit, see php.ini:max-input-vars. PHP Versions before that can run into the same problem caused by a similar limit imposed by suhosin, see its config

Increase the limit or change the way you transfer the data.

Community
  • 1
  • 1
Stephan B
  • 3,671
  • 20
  • 33
  • Thank you. That one had me stumped! – user1032531 Jun 14 '12 at 12:37
  • I had this same problem today and I didnt want to increase the value from max-input-vars. So, I used a jquery to .serialize() the form and sent only one input with this big string to php. After that I tried json_decode/parse_str and other JSON libs, all without success. Then, I tried mb_parse_str() and it worked. Original form had 3960 inputs of tabular data (mostly hidden). – StackUnder Dec 12 '13 at 00:17
1

In php.ini there is the following configuration directive:

; Maximum size of POST data that PHP will accept.
; http://php.net/post-max-size
post_max_size = 8M
Aurel
  • 385
  • 2
  • 5
1

In php.ini look for

post_max_size = 10M
greenLizard
  • 2,326
  • 5
  • 24
  • 30
0

http://support.microsoft.com/kb/208427 says IE has limits of about 2k, I do remember HTML has some limits but I thought the HTML limit was on get not post.

BugFinder
  • 17,474
  • 4
  • 36
  • 51