Skip to main content

Fixing max_input_vars Errors in PrestaShop

If you see a warning about max_input_vars when saving a module's configuration, it means PHP is receiving more form fields than it is allowed to process in a single request. This guide explains what this means, why it happens, and how to fix it.

🧩 What is max_input_vars?​

max_input_vars is a PHP setting that limits the number of input variables (form fields, query parameters) that PHP will accept in a single HTTP request. The default value is 1000.

When a form submission contains more than this limit, PHP silently drops everything above the threshold. Fields 1001 onward are never received by the server β€” they simply disappear.


❗ Why does this happen with module configuration forms?​

Some modules have configuration forms that generate many fields β€” especially when they allow settings to be configured per category, per shop, or per language. In a store with a large catalogue, the number of form fields multiplies quickly:

  • A module with 10 settings Γ— 50 categories Γ— 3 languages = 1,500 fields

This exceeds the PHP default of 1,000, causing the form to be silently truncated.

Silent data loss risk

Before the module added this warning, there was no visible indication that fields were being dropped. The form appeared to save normally, but settings for categories beyond the threshold were silently reset to empty or default values. If you have seen inconsistent settings in your module configuration, this may be the cause.


βœ… How to fix it​

You need to increase the max_input_vars value in your PHP configuration. A value of 3000–5000 is a safe choice for most PrestaShop stores; for very large catalogues, go higher.

Find your php.ini file and add or update the following line:

max_input_vars = 3000

After saving, restart your web server (Apache or PHP-FPM) for the change to take effect.

If you are not sure where your php.ini is, you can find it by running php --ini from the command line, or by checking the output of a temporary phpinfo() page in your store.

Option 2 β€” Hosting control panel​

Most shared hosting providers let you change PHP settings from the control panel:

  1. Log in to your hosting control panel (cPanel, Plesk, DirectAdmin, etc.)
  2. Find the PHP configuration or PHP settings section
  3. Locate max_input_vars and set it to 3000 or higher
  4. Save and apply the change

Some providers call this section "PHP Manager", "MultiPHP INI Editor", or "Advanced PHP Settings."

Option 3 β€” .user.ini (for PHP-FPM environments)​

If you are on a shared hosting plan that uses PHP-FPM and you cannot edit php.ini directly, create or edit a .user.ini file in your PrestaShop root directory:

max_input_vars = 3000

PHP-FPM respects .user.ini files, but changes may take up to 5 minutes to take effect (depending on the user_ini.cache_ttl setting on the server).

Option 4 β€” .htaccess (for mod_php / Apache only)​

If your server uses Apache with mod_php (not PHP-FPM), you can add this line to your .htaccess file in the PrestaShop root:

php_value max_input_vars 3000
warning

This method only works with mod_php. If your server uses PHP-FPM (common on modern hosting), this line will either be ignored or cause a 500 error. Use .user.ini instead for PHP-FPM.


πŸ” How to verify the change worked​

After applying the change, you can verify it by:

  1. Going to your PrestaShop back office β†’ Advanced Parameters β†’ Information
  2. Look for max_input_vars in the PHP information table
  3. Confirm the value shows your updated number

Alternatively, create a temporary info.php file at the root of your store with:

<?php phpinfo();

Search for max_input_vars in the output. Delete this file immediately after checking β€” it exposes server information publicly.


πŸ’Ύ After fixing β€” re-save your module configuration​

Once max_input_vars is increased:

  1. Open the module configuration page
  2. Review your settings β€” any fields that were silently dropped before may be empty or incorrect
  3. Reconfigure anything that looks wrong
  4. Save the configuration

The module's protection layer prevents it from overwriting correctly-saved settings with empty values when the limit is hit, but settings that were never saved in the first place will still be empty until you set them.


βœ… Final Checklist​

  • max_input_vars increased to 3000 or higher in PHP configuration
  • Web server or PHP-FPM restarted (or waited for .user.ini cache to expire)
  • Change verified in PrestaShop back office β†’ Advanced Parameters β†’ Information
  • Module configuration re-opened and reviewed for any blank or incorrect fields
  • Module configuration saved again cleanly

What is max_input_vars and why does it affect module configuration?

max_input_vars is a PHP setting that limits how many form fields PHP will accept in a single request. The default is 1000. Modules with per-category or per-language settings can generate thousands of fields, causing PHP to silently drop everything above the limit.

How do I know if max_input_vars is causing my settings to not save?

If your module configuration appears to save but some settings are always empty or reset after saving, especially for categories beyond a certain point, max_input_vars is likely the cause. Check the PrestaShop back office under Advanced Parameters and then Information to see the current value.

What value should I set for max_input_vars?

A value of 3000 is safe for most PrestaShop stores. For very large catalogs with many categories and languages, set it higher such as 5000 or more to be safe.

I am on shared hosting and cannot edit php.ini. What can I do?

On shared hosting that uses PHP-FPM, create or edit a .user.ini file in your PrestaShop root directory and add the line max_input_vars = 3000. Changes may take up to 5 minutes to take effect. On Apache mod_php hosting, you can add php_value max_input_vars 3000 to your .htaccess file instead.

After increasing max_input_vars, do I need to redo my module configuration?

Yes. Open the module configuration page, review all settings carefully for any that are blank or incorrect due to previous silent data loss, fill them in correctly, and save again.

πŸ†˜ Need Help?​