3

Magento 2.2.1. PHP 7.0.26 Nginx

After 2 days struggling around with attribute options in M2, I found out where the problem was.

I have several custom dropdown attributes with hundreds of options. I created them via REST API and everything was fine, all options created and all values correct. The problem arose as soon as I tried to update/save these attribute again, changing any value, like for example, the "Is filterable".

What happened was that Magento says that the attribute is saved, but in fact, in the above mentioned case, the "use in layered navigation" was simply set to "no".

Nothing in log files, nothing anywhere.

I found out is a PHP memory problem and that I should have increased the

max_input_vars

value in php.ini, from 1000 to something else. I arrived, to try, to 10000000 but I managed to save only 720 options, whereas I need to save at least 1300 options and this is not said to be the limit over time.

Do you have any clue about how to properly set this value? Or what other values?

I also increased

max_execution_time = 3600
max_input_time = 600
post_max_size = 512M
2
  • 1
    I remember running into a similar problem on M1 and PHP 5.x some years ago. Back then we also had to check and raise also suhosin settings as well as a specific firewall setting which I cannot remember unfortunately. Also some browsers can behave strange with a big amount of input fields. Commented Feb 27, 2018 at 18:28
  • actually I also added some params regarding suhosin, but I dunno if it is installed on the server... and dunno if these have some impact on it... but thank you for the hint @AnnaVölkl
    – sissy
    Commented Feb 28, 2018 at 8:39

3 Answers 3

3

I solve this issue by adding below code bottom of .htaccess

## Add Value as required
php_value max_input_vars 6000
1
  • I've tried with same but its not working for me. Commented Aug 9, 2018 at 4:48
3

Issue has been resolved by changing the PHP settings.

max_input_vars = 100000
max_input_nesting_level = 800
max_input_time = 18000
0

I know it's an old thread now but you can also add

max_input_vars = 100000

to your .user.ini files in root and pub/ to get around this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.