PHP/Apache/Ajax - Post Limit

PHP/Apache/AJAX - POST limit?

You'll have to check the limits parameters on all items between you and the server. Quite hard for proxy servers if any, but at least you can check:

Apache:

  • LimitRequestBody, around 2Gb by default, maybe greater for 64bits, check error logs for details.

PHP:

  • post_max_size which is directly related to the POST size
  • upload_max_filesize which may be unrelated, not sure
  • max_input_time, if the POSt takes too long
  • max_input_nesting_level if your data is an array with a lot of sublevels
  • max_execution_time, but quite sure it's not that
  • memory_limit, as you may reach a size exceding the subprocess allowed memory
  • max_input_vars, if your data array has many elements

If you have reached the compiled in limit for Apache your only solution is to avoid direct POSt of such a big chunk of data, you'll have to break it into pieces.

jquery ajax POST size limit?

I figured it out. For some reason NetBeans' debugger tells me $_POST['data'] is null, but it's not. To manually determine the size of the $_POST received, I used these calls:

$request = http_build_query($_POST);
$size = strlen($request);

Also, I was putting $_POST['data'] into CodeIgniter's session:

$event_array = array('event' => $_POST['data']);
$this->session->set_userdata($event_array);

Which was coming up empty leading me to further believe that $_POST was empty. But the problem was instead $this->session, which apparently has a 4K size limit (according to this post).

jQuery ajax POST data variable can hold max 199 json array

What "Hussy Board" said you can change in php.ini the max_input_vars, the default limit is 1000. Also checkout the post_max_size

Is there any size limitation for ajax post?

The HTTP specification doesn't impose a specific size limit for posts. They will usually be limited by either the web server or the programming technology used to process the form submission.

What kind of server do you use?

Size limits on POST

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.

Increasing the maximum Ajax POST size

You should check on the max length of the field in the database. For example, if your field is set to VARCHAR(1000), it is only going to accept 1000 characters. Increase the length of the data type accordingly.



Related Topics



Leave a reply



Submit