When phppost is submitted, Inputvariablesexceeded1000 appears.

Source: Internet
Author: User
When the post object is submitted, the following error may occur when the array is too large: {code ...} the solution is to open php. ini, modify the max_input_vars1000 parameter, and change the default value of 1000 to a greater value. It seems very simple. However, if the user who receives the post request, when the server environment... post is submitted, this may occur when the array is too large:

Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars

The solution is to open php. ini and modify the parameters.
Max_input_vars = 1000;

Change the default value of 1000 to a greater value.

It seems very simple. However, if you receive post requests from users in various server environments, you cannot change this parameter for anyone using your services.

Therefore, I will handle the post array with json_encode and base64 first. It takes 0.3 seconds for the server to parse these arrays. It is 100 times more than the previous cost. This is still inappropriate. If memory_limit is set to too small, the system prompts insufficient memory.

Both solutions have their own shortcomings.

If it is you, how do you deal with this problem?

Reply content:

When the post object is submitted, the array is too large:

Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars

The solution is to open php. ini and modify the parameters.
Max_input_vars = 1000;

Change the default value of 1000 to a greater value.

It seems very simple. However, if you receive post requests from users in various server environments, you cannot change this parameter for anyone using your services.

Therefore, I will handle the post array with json_encode and base64 first. It takes 0.3 seconds for the server to parse these arrays. It is 100 times more than the previous cost. This is still inappropriate. If memory_limit is set to too small, the system prompts insufficient memory.

Both solutions have their own shortcomings.

If it is you, how do you deal with this problem?

I chose the second solution, which is passed in json.

First, I don't know how to calculate that json resolution is 0.3 seconds slower than post resolution, that is, how do you know how much time it takes to parse post?

Second, the json format is more customizable than form-data, and provides better support for lists and objects, it can reduce the size of transmitted data.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.