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.
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: 5000 or 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 apache2
or
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_vars in 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.


