max_input_vars in Bitrix: What It Is and How to Adjust It
24.08.2025
The max_input_vars setting in PHP controls the maximum number of input variables (e.g., GET, POST, or COOKIE variables) that PHP can handle in a single request. In Bitrix, a low max_input_vars value can cause issues with large forms, settings pages, or when saving configurations, especially in admin panels.
For other Bitrix-tuning topics, see Setting mbstring.func_overload for Bitrix, Bitrix Error Log — Locate, Enable, Analyze, and Bitrix Virtual Appliance (BitrixVA).
Common Errors Caused by Low max_input_vars
- Form Submission Issues:
- Some fields may not save, or partial data is submitted.
- Example error: "Data is missing or incomplete."
- Admin Panel or Module Issues:
- Errors when saving settings with many fields.
- Menu and Permission Settings:
- Long menus or permissions configurations fail to save.
Default Value of max_input_vars
- Default value:
1000 - This is often insufficient for Bitrix installations with complex configurations.
Recommended Value for Bitrix
- Recommended value:
5000or higher. - For very large forms or configurations, you may need to increase it further.
How to Adjust max_input_vars
Update php.ini
- Locate your PHP configuration file:
php --ini - Open php.ini for editing:
sudo nano /etc/php/7.x/apache2/php.ini - Increase the max_input_vars value:
max_input_vars = 5000 - Restart the web server:
sudo systemctl restart apache2or
sudo systemctl restart php7.x-fpm
Update .htaccess (If You Cannot Edit php.ini)
- Open the .htaccess file in your website root directory.
- Add the following line:
php_value max_input_vars 5000
Update user.ini (If .htaccess Does Not Work)
- Create or edit a .user.ini file in your website root directory.
- Add the following line:
max_input_vars = 5000 - Restart PHP:
sudo systemctl restart php7.x-fpm
Use ISPmanager or cPanel
If your server is managed via a control panel like ISPmanager or cPanel:
- Go to PHP Settings or PHP Selector.
- Find max_input_vars and increase it to 5000.
- Save and restart PHP from the panel.
Verify the Change
- Create a phpinfo.php file in your root directory:
<?php phpinfo(); ?> - Open it in your browser:
http://yourdomain.com/phpinfo.php - Look for
max_input_varsin the output to confirm the new value.
Troubleshooting
| Issue | Solution |
|---|---|
| Changes not applied | Ensure you are editing the correct php.ini or .htaccess file. |
| Bitrix still shows errors | Double-check the new value in phpinfo() output. |
| Large forms still fail | Increase the value further (e.g., max_input_vars = 10000). |
| Multiple PHP versions on server | Update php.ini for the correct PHP version. |
- The max_input_vars setting is crucial for Bitrix to handle large forms and configurations.
- Set the value to 5000 or higher to avoid errors.
- Use php.ini, .htaccess, or control panel tools to adjust the value.
Silently saves only the first N fields and discards the rest. No error in the UI; the saved record looks normal until you notice fields are blank or have stale values. Diagnostic clue: count() of $_POST in a phpinfo() page shows close to your max_input_vars cap. Bitrix's Settings panel especially submits 500-3000 fields; bumping to 5000-10000 is normal for production.
php.ini for global. .user.ini in DOCUMENT_ROOT for per-site override. Bitrix-installed via BitrixVA: edit `/etc/php.d/00-bitrix.ini` (or equivalent). After change, restart PHP-FPM or Apache. Verify with phpinfo() showing the new value, then test Bitrix admin form that previously truncated.
Small site (single iblock, < 50 properties): 3000 is enough. Medium (catalog with categories, multiple iblocks): 10000. Large (multi-shop, rich property hierarchies): 20000-50000. Bitrix's official docs say 10000 as baseline; raise if you still see truncation. Higher values use slightly more memory per request but trivially.
Mostly admin — front-end forms rarely have 1000+ fields. But large checkout forms with many product configurators, or import wizards exposed to merchants, can hit it. If a front-end form silently loses data, max_input_vars is the first thing to check before looking at form validation code.
Bandwidth Limit Exceeded: Causes and Solutions
Bitrix MySQL Freezes: Causes and Solutions
"Script Encountered an Error — Enable This Feature in .settings.php"


