PHP drops form fields and warns that input variables exceeded 1000
Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini.Short answer
PHP accepts only max_input_vars variables per request (default 1000) and throws away the rest, with a warning. Big forms, menu editors and bulk-edit screens hit it. Raise max_input_vars where your PHP runs, in php.ini, .user.ini or the Apache config, then reload. If the warning stays, the setting went to a file your SAPI does not read.
Fix it fast
1Find out which cause you have
Count what the request really sends, then see which php.ini the command line loads (the web server may use another one). Compare the count with the limit in a phpinfo() page served by the same web server.
php --ini php -i | grep max_input_vars2Match what you see, then jump to its fix
- 1
The warning is in the log and the last fields of $_POST (or the last items of a long array) are gone.One request carries more variables than the limitFix - 2
You edited a setting but phpinfo() through the web server still shows 1000.The value was set in a file the running PHP does not readFix - 3
A php_admin_value line, or a higher-level value in the Apache config, keeps the old number.The setting was locked or set at a level that winsFix
- 1
What does the error look like?
Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini.Fields at the end of a big form are missing from $_POST
Cause 1 of 3
One request carries more variables than the limit
1Check
The manual says the limit is applied to $_GET, $_POST and $_COOKIE separately, and that extra variables are truncated from the request. Count the keys the form posts; every input in a nested array counts as one variable.
// temporary line at the top of the receiving script
error_log('POST variables: ' . count($_POST, COUNT_RECURSIVE));2Fix
Raise max_input_vars in php.ini to a value above the largest form you need. max_input_vars is an INI_PERDIR setting, so it cannot be changed with ini_set() inside the script.
; php.ini
max_input_vars = 50003Verify
Reload PHP (PHP-FPM or Apache), then open phpinfo() through the web server and read the max_input_vars row.
sudo systemctl reload php8.3-fpmConfirmed by php.net
Cause 2 of 3
The value was set in a file the running PHP does not read
1Check
A .user.ini file is processed only by the CGI/FastCGI SAPI, and PHP re-reads it every user_ini.cache_ttl seconds (default 300). php_value lines in .htaccess work only when PHP runs as an Apache module.
php --ini
php -i | grep -E "user_ini|SAPI"2Fix
Under PHP-FPM or CGI, put the line in a .user.ini in the site's directory and wait for the cache time. Under Apache with mod_php, use php_value in the Apache config or .htaccess (AllowOverride Options or All is needed for .htaccess).
; .user.ini (PHP-FPM / FastCGI)
max_input_vars = 5000
# .htaccess (Apache module only)
php_value max_input_vars 50003Verify
Wait out user_ini.cache_ttl, then reload the phpinfo() page and read the value again.
php -i | grep user_ini.cache_ttlConfirmed by php.net
Cause 3 of 3
The setting was locked or set at a level that wins
1Check
A value set with php_admin_value cannot be overridden by .htaccess or ini_set(). Search the Apache config for it.
grep -R -n 'max_input_vars' /etc/apache2/ /etc/php/ 2>/dev/null2Fix
Change the number in the place that sets it, not in a lower-level file.
# in the Apache vhost, if this is where it is set
php_admin_value max_input_vars 50003Verify
Reload Apache and check phpinfo() again.
sudo apachectl configtest && sudo systemctl reload apache2Confirmed by php.net
How do I stop it coming back?
- Treat a very large form as a design problem: split it into steps or send it as one JSON field, so it never needs thousands of variables.
- Keep max_input_vars in one config file and note it next to the app's deploy steps.
- Watch the PHP error log after adding fields to admin screens, because the truncation is silent except for the warning.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Back end
Apache returns 503 or 504 because PHP-FPM did not answer in time
Error dispatching request
Apache sent the request to PHP-FPM and gave up waiting.
3 causes, each with a fixBack end
AWS SDK for PHP cannot get credentials from the instance profile metadata server
Error retrieving credentials from the instance profile metadata server.
The SDK tries the EC2 instance metadata service when it has no valid credentials from anywhere earlier in its chain.
4 causes, each with a fixBack end
AWS SDK for PHP rejects requests: the signature is from the future
Signature not yet current: {date} is still later than {date}
AWS compares the timestamp in your signed request with its own clock.
2 causes, each with a fixBack end
CodeIgniter 4 cannot write its cache files
CodeIgniter\Cache\Exceptions\CacheException: Cache unable to write to /var/www/app/writable/cache/
CodeIgniter 4's file cache needs a cache directory that the web server can really write to.
2 causes, each with a fixBack end
CodeIgniter 3 loads the model but the property is undefined
The model name you are loading is the name of a resource that is already being used: user
CodeIgniter 3 expects a model file named like its class, with the first letter capitalised, for example User_model.php holding class User_model.
2 causes, each with a fixBack end
CodeIgniter 3 stops with "Your system folder path does not appear to be set correctly"
503 Service Unavailable
CodeIgniter 3's front controller resolves $system_path and then checks that the result is a directory.
3 causes, each with a fix