max_input_vars issue in prestashop translations feature

max input vars prestashop translation error


In this article i want to say something about max_input_vars issue, which is common error in prestashop translations feature. For the first i want to say that this isn't prestashop error. This is issue related to the your webservice (hosting) configuration. What does it mean? It mean that the only way to fix this issue is an access to hosting configuration files - without this it will be unavailable to fix... BUT if you have got PHP in version 5.3+ you can use some easy solution. So, I want to show you, how to configure it properly. For the first i want to say something more what exactly max_input_vars is:


max_input_vars - what is it?

This is php configuration parameter - it says how many input variables may be accepted (this kind of limit is applied to $_GET, $_POST and $_COOKIE superglobal variables separately). This variable was created for fighting with hackers. Use of this directive mitigates the possibility of DOS (denial of service) attacks which use hash collisions. Is ome website uses more input fields / variables than specified by this directive, an E_WARNING is issued, and further input variables are truncated from the request. This limit applies only to each nesting level of a multi-dimensional input array.


max_input_vars is configuration param which works in PHP_INI_PREDIR mode. What does it mean? It mean that value of this param can be set in php.ini, .htaccess, httpd.conf or user.ini files - but this is available since PHP 5.3



Easiest way to fix it

If your webhosting service uses PHP in version 5.3+ you can try to fix this by creating own value of this param. All you have to do is editing .htaccess file in your prestashop root directory. You must add there line that i pasted below:

php_flag max_input_vars 4000

It should work, but maybe your ISP don't allow to do that - we don't know - so you must check it by yourself. And what you can do, if your webhosting service doesnt allow to change this param in this way? Read other suggestions below:



How to change max_input_vars param value?

As i said above, you must have got an access to php.ini configuration file. Where you can find it out? Well, this is related for hosting configuration. In some cases you can edit this file via hosting control panel, like cpanel, directadmin or aruba control panel, in other cases you can find this file on your FTP. I assume now that you have access to this file. So, for the first open it and search for:

max_input_vars = 1000

Increase the 1000 value. You should set it up with sufficient value. In error that i pasted above, you can see something like:

"..increase this limit to 3543..."

so this value is minimal value of max_input_vars variable. It is better to enter a greater than minimal value, because you can always install new modules, which increases the demand. So, i set it up to 4000:

max_input_vars = 4000

Save changes and save the configuration or reupload this file into your hosting. Now it should works for you. 



I changed configuration file but it doesn't work 

Sometimes webhosting works with feature called suhosin. it doesn't matter what this is. But in this case you should also change values of suhosin max input vars. Just open the same php.ini file and find out variables:

suhosin.request.max_vars = 1000 = 1000

and change values to 4000, exactly as below:

suhosin.request.max_vars = 4000 = 4000



What can I do if I haven't got access to the configuration?

For the first, you should ask your webhosting probvider to increase max_input_vars value. It's hard to say, but many webhosting companies don't want to do that due to the security restrictions. So, what then? You can create WAMP server on localhost (if you use windows OS) and edit module translations there - then upload language files to the ftp. It should works :) We will write tutorial about dealing with WAMP and prestashop, see you soon :-)


Fix for GoDaddy hosting:

if you use outstanding GoDaddy host, you have to use a bit different method, just read this tutorial: GoDaddy host and max input vars issue

author milos myszczuk
Article by Milosz Myszczuk PrestaShop expert, official PrestaShop community moderator. PHP developer, specialist in relative and spatial databases management, GIS Analyst, CEO & founder of VEKIA interactive agency. Read more about VEKIA company
If you like my articles and want much more valuable tips, feel free to send me donation
1.4 version 1.4.11 1.6 404 addon admin advertise ahref ajax alpha animation api app application authentication back office backup badge banner basics block bootstrap button cache carrier cart catalog category certificate changelog chat class clear client clip cms code colors columns comments configuration contact container content controller cookie counter country coupon css csv currency customer dashboard database debug default delete delivery desktop developer device disable discount displayNav displayTop download dynamic editor effect empty encrypt engine error exchange exclude export facebook faceshop fade fancoupon fancybox fanpage fatal feature feed field file fix fixed font footer free friendly url front ftp full gallery generate gift global godaddy google google+ gray grid groupon header help hide highlight homefeatured homepage hook hosting hover howto htaccess html html5 ID image import include input instagram installation integration iPhone issue javascript jquery kgb knowhow languages law left likebox link list livingsocial loading log login logo loyality mail mailing maintenance manufacturer marketing marquee mcrypt menu meta mobile modification module movie moving multilanguage multiupload must have mysql news newsletter notification number open graph order override page password performance PHP phpmyadmin picture pinterest plugin popup post prestashop prestashop 1.0 prestashop 1.1 prestashop 1.2 prestashop 1.3 prestashop 1.4 prestashop 1.5 price rules problem product profile promotion proslider purifier quantity query quick tip random rates register reinsurance release reporting reset responsive restore results ribbon rich text right sales search security seo service shadow share shipping shop shopmania slider smarty social networks SQL SSL statistics stock store style subcategory superuser support switcher tab tablet tag tax template text theme tinyMCE tips and tricks tpl tracking translations tree trends trigger tumblr tutorial twitter update upgrade upload variables video visits voucher vulnerability web2print wide widget width window wishlist wysiwyg youtube zip zopim