Maximum php message size?

Could it be that the POST request is limited in size? I have a great procedure with which I want to cache output. Basically, I want to store the lare html table in the cache due to the growth of a particular project, the number of requests, and therefore the response time is out of control.

Now I am sending a large output, which is extracted by an ajax call, in another ajax call (after the first completion), but I receive only a small part of the data. I think my ajax function is correct, because the stored output is always the same (in characters). But I miss about 90% of the cache output ...

+4
source share
3 answers

there is a maximum size of 8 MB for the POST method (you can change it by setting post_max_size in the php.ini file).

"Could it be that the POST request is limited in size?"

Yes, there is a PHP parameter: post_max_size

+7
source

Look for these settings in php.ini

 ; Maximum size of POST data that PHP will accept. ; http://php.net/post-max-size post_max_size = 8M ; Maximum amount of memory a script may consume (128MB) ; http://php.net/memory-limit memory_limit = 128M 

post_max_size indicates the maximum size of the POST, and since it should be kept in memory, the memory limit should be greater. The memory should contain the current program and all heap variables, including POST.

If you increase only post_max_size within or close to the memory limit and forget to increase memory_limit, the POST size will be limited to a smaller value when the memory is exhausted.

In this example, you can see the default settings.

+2
source

I myself ran into this problem and found that with PHP 5.3.9 there is a new parameter that limits the total number of post variables (not just size).

 max_input_vars = 1000 

Perhaps this was the same problem you encountered if you were using the night or release version of PHP at that time.

+2
source

All Articles