Fix Configuration Not Saving in Magento 2
Saving your Magento 2 configuration but nothing changes? You might see a success message, yet values revert to their previous state. This is often caused by PHP's max_input_vars limit being exceeded.
The Problem
Magento 2 configuration pages can contain hundreds or even thousands of form fields, especially when you have multiple store views or websites. PHP's max_input_vars directive (default: 1000) limits how many input variables can be submitted in a single request.
When this limit is exceeded, PHP silently truncates the POST data. Magento receives incomplete data but doesn't know anything is missing, so it appears to save successfully while only partial (or no) changes are actually stored.
Symptoms
- Configuration shows "success" message but values didn't change
- Some fields save correctly, others revert to previous values
- Problem occurs on pages with many fields (System Config, extension settings)
- Works fine on smaller configuration pages
- Issue is worse with multiple store views/websites
Quick Diagnosis
Check Current Limit
php -i | grep max_input_vars
Or create a phpinfo.php file in your webroot:
<?php phpinfo();
Look for max_input_vars in the output.
Check POST Data Size
Open browser DevTools (F12), go to the Network tab, submit your config form, and check the request payload. Count the parameters or look at the Form Data section.
Solution
Increase max_input_vars in your PHP configuration.
Via php.ini
Find your php.ini file and update:
max_input_vars = 10000
Restart PHP-FPM or your web server after making changes.
Via .htaccess (Apache with mod_php)
Add to your Magento root .htaccess:
php_value max_input_vars 10000
Via .user.ini (PHP-FPM)
Create or edit .user.ini in your Magento root:
max_input_vars = 10000
Note: Changes via .user.ini may take a few minutes to apply (controlled by user_ini.cache_ttl).
Recommended Values
| Store Setup | Recommended Value |
|---|---|
| Single store | 5000 |
| 2-5 store views | 10000 |
| 5-10 store views | 20000 |
| 10+ store views | 30000+ |
Verify the Fix
After making changes:
- Restart PHP/webserver
- Check the new value:
php -i | grep max_input_vars - Try saving your configuration again
- Verify values are actually stored
bin/magento config:show path/to/your/config
Troubleshooting
Still Not Working
Contact your hosting provider. Some hosts don't allow changing this value directly, or the setting may be managed elsewhere.
Suhosin Extension
If you have the Suhosin security extension installed, it has its own limits:
suhosin.post.max_vars = 10000
suhosin.request.max_vars = 10000
Cloudflare / WAF
Some CDNs or Web Application Firewalls limit POST request size. Check your CDN settings if PHP configuration is correct.
Related Settings
Other PHP settings that can affect form submissions:
; Maximum POST data size
post_max_size = 64M
; Maximum number of files in one request
max_file_uploads = 20
; Maximum execution time (large configs may timeout)
max_execution_time = 300
Prevention
For stores with many store views, consider:
- Using
bin/magento config:setfor bulk configuration changes - Storing configuration in
app/etc/config.php(environment-specific config) - Using deployment pipelines to manage configuration
Need More Help?
Documentation:
- All Help Articles - Complete documentation overview
Support:
- Contact Support - Get help from our team