1

I'm send a large array via POST to the server but when I output the $_POST variable some parameters are cut off

echo '<pre>'.print_r($_POST , true).'</pre>';

It seems the array is always cut off at the same length so if i add elements at the beginning of the array one element at end will get removed.

This happens only on some servers so I guess it's a wrong setting or some server limitations.

The post_max_size is always above 64 mb and the post is not even close to that size

How can I get around this?

Xaver
  • 11,144
  • 13
  • 56
  • 91
  • 1
    Did you ever figure out the issue? I'm having the same problem. My php.ini file seems good, and the size of the POST is nowhere near the different max values. – lorenzo Jun 24 '19 at 14:13
  • See the answer from @kay-angevare – Xaver Dec 01 '22 at 19:32

2 Answers2

4

I stumbled upon this question in my search with a similar nature. If anyone lands on this page, you might want to also check out this answer by Mr. Robinson:

Try changing max_input_vars as well. More information: . . . .

https://stackoverflow.com/a/12667018/11787139

Kay Angevare
  • 639
  • 6
  • 17
1

You need to set the value of upload_max_filesize and post_max_size in your php.ini :

; Maximum allowed size for uploaded files.
upload_max_filesize = 40M

; Must be greater than or equal to upload_max_filesize
post_max_size = 40M

After modifying php.ini file(s), you need to restart your HTTP server to use new configuration.

You can also use ini_set function:

ini_set('post_max_size', '64M');
ini_set('upload_max_filesize', '64M');
Petro
  • 3,484
  • 3
  • 32
  • 59