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
Replace a Whole Line Where a Particular Word Is Found in a Text File
Header Only Retrieval in PHP Via Curl
Check If a User/Guest Has Purchased Specific Products in Woocommerce
Formatting Datetime Object, Respecting Locale::Getdefault()
Dompdf and Set Different Font-family
Why Is Using a MySQL Prepared Statement More Secure Than Using the Common Escape Functions
PHP: Utilizing Exit(); or Die(); After Header("Location: ");
How to Access a Property With an Invalid Name
Best Way to Do Multiple Constructors in PHP
How to Make a Simple Crawler in PHP
Who Should Handle the Conditions in Complex Queries, the Data Mapper or the Service Layer
PHP Library For Parsing Xml With a Colons in Tag Names
Amazon S3 - How to Fix 'The Request Signature We Calculated Does Not Match the Signature' Error
Is There a Built-In Way to Get All of the Changed/Updated Fields in a Doctrine 2 Entity
How Does the Keyword "Use" Work in PHP and How to Import Classes With It
$_Server['Http_Referer'] Missing
How to Properly Use a Pdo Object For a Parameterized Select Query