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?
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.
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.
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.
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.
Use ini_get
.
ini_get('post_max_size');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With