PHP post submission appears input variables exceeded 1000

Source: Internet
Author: User
When the post is submitted, the array is too large to be able to appear:

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

The solution is: open php.ini, modify parameters
Max_input_vars = 1000;

Change the default of 1000 to a larger value.

The seemingly simple question. But if you receive the POST request user, the server environment is various, you can not let all the people who use your service to change this parameter.

So, I put the post array, first Json_encode and base64 processing. into a parameter, but the service side resolves these arrays and took 0.3 seconds to resolve them. It costs 100 times times more than before. It's still inappropriate. and Memory_limit if the settings are too small, the memory is not sufficient.

Both options have drawbacks.

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

Reply content:

When the post is submitted, the array is too large to be able to appear:

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

The solution is: open php.ini, modify parameters
Max_input_vars = 1000;

Change the default of 1000 to a larger value.

The seemingly simple question. But if you receive the POST request user, the server environment is various, you can not let all the people who use your service to change this parameter.

So, I put the post array, first Json_encode and base64 processing. into a parameter, but the service side resolves these arrays and took 0.3 seconds to resolve them. It costs 100 times times more than before. It's still inappropriate. and Memory_limit if the settings are too small, the memory is not sufficient.

Both options have drawbacks.

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

I choose the second option, JSON pass.

First of all, I don't know how you figure out that JSON parsing is 0.3 seconds slower than post parsing, so how do you know how long it takes to parse post?

Second, the JSON format is compared to Form-data, which can be customized more, for lists, objects, etc., have better support, the use of these things, can be a good way to reduce the size of the transmission of 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.