I'm having trouble figuring out what the problem is with the following $_POST request. The issue is that I am $_POSTing an array with 855 records via AJAX, but my AJAX controller is only receiving 833. It's always the same records received, and it always cuts out at the same point:
JQuery:
var f = {};
f.chargeID = chargeID;
f.method = 'saveIndividualApplications';
f.individualAmounts = individualAmts;
processing.show();
console.log(f); //all records present
console.log(Object.keys(f.individualAmounts).length); //855
return $.ajax({
type: 'post',
cache: false,
url: appControllerPath,
data: f
});
PHP controller:
$displayMaxSize = ini_get('post_max_size'); //125912
file_put_contents('post', $_SERVER['CONTENT_LENGTH'] . "\r\n"); //240M (increased this to 240 just to check)
file_put_contents('post', $displayMaxSize . "\r\n", FILE_APPEND);
file_put_contents('post', print_r($_SERVER, true), FILE_APPEND);
file_put_contents('post', count($_POST['individualAmounts']) . "\r\n", FILE_APPEND); //833
file_put_contents('post', print_r($_POST['individualAmounts'], true), FILE_APPEND); // data cuts off midway through 833rd record (although the array seems to close fine)
It can be limited by max_input_vars
config option, by default it's limited to 1000. Inroduced in 5.3.9, check the PHP runtime config
Or if you are using Suhosin it may by limited by it
[suhosin]
suhosin.request.max_vars = 1000
suhosin.post.max_vars = 1000
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With