new limit within php: 1000 fields per POST. Does someone know, if the number can be influenced?

new limit within php: 1000 fields per POST. Does someone know, if the number can be influenced?

  1. Blog
  2. 15 November 2026
  3. 3 min read

Stefan Bogdanescu

Founder & Senior Architect

The max_input_vars Limit in PHP and How to Adjust It

Starting with PHP 5.4, a new security-focused restriction was introduced regarding the number of input variables allowed per request. This limit defaults to 1000 fields for POST and GET requests. While this threshold prevents potential denial-of-service attacks caused by massive array submissions, it immediately breaks legacy applications or custom forms that rely on bulk data entry. If you are encountering errors where your application stops processing after the 1000th field, this is the mechanism at play.

The default limit exists because parsing thousands of parameters consumes significant memory and CPU cycles. Without a cap, a malicious actor could craft a request with millions of dummy variables to exhaust server resources. However, for legitimate use cases like uploading large datasets or processing complex multi-step forms, the 1000-field ceiling is often too restrictive.

Locating the Configuration Variable

The variable responsible for this constraint is max_input_vars. Unlike older configurations that might have required recompiling the PHP binary or editing the core source code to change these thresholds, max_input_vars is designed specifically to be adjustable at runtime or via configuration files without rebuilding the environment.

You can verify if your current installation has hit this limit by inspecting the active value during execution. Run the following snippet in a PHP context:

phpinfo();
// Look for "max_input_vars" under the "PHP Environment" section

Alternatively, you can check it directly from your code using the get_cfg_var() function or by accessing the server configuration array if available via the SAPI. If the output shows 1000, your application is subject to the hard limit introduced in PHP 5.4.

Adjusting the Limit Safely

To influence this number, you must modify the value of max_input_vars in your php.ini file. Locate the setting and change it to a higher integer, such as 3000 or 6000, depending on your server's memory capacity.

; In php.ini
max_input_vars = 3000

It is important to note that changing this variable alone does not guarantee success. Increasing the limit directly impacts memory usage. If you parse 2000 variables without adjusting other related limits, your script might trigger a separate memory exhaustion error before hitting the input variable cap. You must also ensure that post_max_size and upload_max_filesize (if applicable) are configured to handle the increased overhead of parsing larger payloads.

The Trade-off: Memory vs. Functionality

Raising max_input_vars is not a free operation. Each additional variable processed adds to the memory footprint of the request. If you increase the limit without monitoring server memory, you risk causing your web server to crash under load.

Before applying changes like max_input_vars = 3000, consider the cost:

  • Memory Consumption: More variables mean more stack usage during parsing.
  • Security Surface: While the default prevents DoS attacks via massive arrays, setting it too high without proper monitoring could expose your server to resource exhaustion if input validation elsewhere fails.

If you are running PHP 5.2 or earlier builds where this setting might not exist or behave differently, upgrading to a supported version of PHP (such as 5.4 or later) is the recommended path to access max_input_vars reliably.

Implementation in Modern Frameworks

If your application runs on Laravel or similar frameworks, you do not need to modify system files if you are using PHP 7.0+ with OPcache or standard configurations. You can set this limit dynamically by creating a custom configuration file or adding it to the .user.ini file in specific web directories:

; Add to .user.ini for specific project directory
max_input_vars = 5000
memory_limit = 256M

This approach allows you to isolate the setting to your application without affecting other sites on the same server. Always test thoroughly after increasing these limits, as the combination of max_input_vars and memory_limit determines whether a request completes successfully or fails due to resource constraints.

Our network