Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP How to find maximum allowed POST data?

Tags:

post

php

In PHP, is there a quick way to find the maximum allowed size of POST data for any server configuration that my script is run on?

For example, $max_post_length = $_SERVER['maxpost']; or something. Perhaps it would return 0 for 'no limit'...any ideas?

like image 851
Ben Avatar asked Dec 15 '10 00:12

Ben


People also ask

What is PHP Max POST size?

By default, PHP file upload size is set to maximum 2MB file on the server, but you can increase or decrease the maximum size of file upload using the PHP configuration file ( php. ini ), this file can be found in different locations on different Linux distributions.

How can change maximum number of POST variable in PHP?

By default, the maximum number of input variables allowed for PHP scripts is set to 1000. You can change this amount by setting the max_input_vars directive in a php. ini file.

What is the maximum size of POST request?

The default value of the HTTP and HTTPS connector maximum post size is 2MB. However you can adjust the value as per your requirement. The below command to set the connector to accept maximum 100,000 bytes. If the http request POST size exceeds the 100,000 bytes then connector return HTTP/1.1 400 Bad Request.

How much data we can send through post method?

There is no defined limit, according to the RFC. If you are using a web browser for GET , then you are generally going to be limited to around 2K for the full URL. For POST , you are unlikely to hit a limit at any practical level.


1 Answers

Use ini_get.

ini_get('post_max_size');
like image 97
Ben Avatar answered Oct 12 '22 23:10

Ben