Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP/JSON: $_POST array is received incomplete

Around 100 rows of data are posted using $.post (JQuery) as JSON array. But for some reason not all rows are received.

The data looks more or less like this (contents are basically numbers and small strings):

rows = [["U", "0", "81949", 32 more...], ["U", "0", "81950", 32 more...] ..... ]

The way I'm sending the data is:

$.post(url+"callback=?", { data : rows }, function(){}, "json");

If I echo the number of rows (count($_POST)) received in my local version it shows "100", but at the production server it displays "25" (every time is the same amount).

Checking the request details in firebug, it shows correctly that all 100 has been sent.

I though it could be the PHP "post_max_size" value, but I had it set to "100M", which I think is by far enough.

I'm pretty sure it has to be with the server settings, but I'm out of ideas... Thanks in advance.

UPDATE:

  • The production server has 8GB of Memory, which is using about half of it (it is not a memory issue).
  • There is no timeout (all the process is done in about 3 seconds).
like image 419
lepe Avatar asked Mar 18 '26 21:03

lepe


1 Answers

There is already an accepted answer, but for those not using suhosin, the problem may be a low "max_input_vars" php setting. Mine was set to 1000 by default, which was not enough.

like image 115
Todd Kamin Avatar answered Mar 21 '26 09:03

Todd Kamin