Is there a cap on the number of products that can be in a category? I can’t find any documentation that says so.
We are finding that we cannot add more than 1001 products using the admin category management interface (category products tab), any extra products are ignored.
I’ve just found the explanation:
Since PHP version 5.3.9 , the function parse_str appears to be subject to the php.ini directive “max_input_vars”, which is 1000 by default.
The setting is changeable in php.ini, .htaccess or httpd.conf, but not during runtime.
I’ve just found the explanation:
Since PHP version 5.3.9 , the function parse_str appears to be subject to the php.ini directive “max_input_vars”, which is 1000 by default.
The setting is changeable in php.ini, .htaccess or httpd.conf, but not during runtime.
Much appreciated this fix was the problem with our Magento Enterprise. Changed the php.ini file, added the variable change as it was not part of the php.ini - rebooted Apache - was able to add more than 1001 products to a category.
So, what rule of thumb do we use on setting max_input_vars?
Is increasing it to a value of say, 5000 sufficient or does it have to be a (MaxNumberOfItemsInCategory + 100) type of setting?
Also mentioned as a source of problems in php applications, the setting max_input_nesting_level. Has anyone encountered this being an issue in Magento?
Thank you ... you’d think that magento would throw some sort of error when this limit was reached. I spent a couple of hours trying all sorts of things before realizinf=g there was something magical about 1001 ... so thank you google ‘1001 limit products category magento’ got me here.
Easy fix once you know!
Imagine all those people out there on 999 products in a category having to go through the agony again!
symfony XIB - 20 March 2012 02:23 PM
Hi,
I’ve just found the explanation:
Since PHP version 5.3.9 , the function parse_str appears to be subject to the php.ini directive “max_input_vars”, which is 1000 by default.
The setting is changeable in php.ini, .htaccess or httpd.conf, but not during runtime.
Having raised max_input_vars to 20,000, three days later we had SSH-Root-Access problems and a server crash. Of course, we’re not sure it was due to this (it’s kinda strange anyway), but since setting it back to 1,000 there are no problems anymore.
The best solution is not to increase max_input_vars, which is meant after all to mitigate a security vulnerability, but to fix the code. One fix was previously posted to this thread. Another is here:
I’m saddened, but sadly unsurprised by this issue and the support team’s response.
Here’s a configuration-based solution that increases max_input_vars, but only for requests within the Magento admin URL space. So the default value remains in effect for the public-facing forms.
I prefer this method to overwriting Magento core Adminhtml files, since it protects from inadvertent breakage in future Magento upgrades.
Thanks Michael. This is a better way of handling reopening a massive security hole by limiting it to the admin instead of systematically recreating the problem for the whole website.
I’m saddened, but sadly unsurprised by this issue and the support team’s response.
Here’s a configuration-based solution that increases max_input_vars, but only for requests within the Magento admin URL space. So the default value remains in effect for the public-facing forms.
I prefer this method to overwriting Magento core Adminhtml files, since it protects from inadvertent breakage in future Magento upgrades.
In this case, Magento is installed in the “shop” directory, and we know we won’t have categories with over 100,000 products.
I hope this is useful for someone else.
Cheers.
Where should I copy/paste this code to?
My Associated Products (for Configurable product) are stuck at 999 items (seems like the 1000 limit is hit there).
I tried manually changing php.ini but that doesn’t work and if I put it in htaccess as php_value max_input_vars = 4000 I get a 500 internal server error.
Edit - oops. code in htaccess should be php_value max_input_vars 4000 (without the =, seems to work for now, I can add over 1000 associated products without the error. Still would like to know how to implement the slightly more elegant solution above)
I’m saddened, but sadly unsurprised by this issue and the support team’s response.
Here’s a configuration-based solution that increases max_input_vars, but only for requests within the Magento admin URL space. So the default value remains in effect for the public-facing forms.
I prefer this method to overwriting Magento core Adminhtml files, since it protects from inadvertent breakage in future Magento upgrades.
In the .htaccess file. It limits the max_input_vars directive from being allowed to anything but the admin backend so Joe Horndog can’t DDOS your website in case a buffer overflow is found.