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.