Home » Php » php – Does $_POST have a size limit?

php – Does $_POST have a size limit?

Posted by: admin July 12, 2020 Leave a comment

Questions:

Possible Duplicate:
What is the size limit of a post request?

Does $_POST when used in conjunction with forms in PHP have a size limit? Obviously there must be some restrictions with $_GET seeing as most browsers will start to complain at ~250 characters (or something like that) and data could be lost, obviously this restraint doesn’t apply to $_POST.

I could test it myself but thought it might be quicker to simply ask here. If I had a simple form with a textarea, how much data could I enter before I ran into problems?

How to&Answers:

That depends on the value of the PHP configuration directive POST_MAX_SIZE which is usually set to 8 MB (~8 million characters).

Answer:

Yes it has limitation, you can set the limit from several place:

1., in php.ini

post_max_size="8M"

2., from the .htaccess file, if you have

php_value post_max_size 8M 

3., from php side,

ini_set('post_max_size',"8M")

Answer:

yes,

you can change limit from php.ini “post_max_size”

Answer:

It’s a PHP ini directive, post_max_size. It defaults to 8MB.

Answer:

Yes. It’s defined in the php.ini file.

Answer:

Yes the POST data is regulated by the post_max_size variable (default to 8M)