Php max_input_vars prevents attribute options saving in M2












2















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









share|improve this question

























  • 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.

    – Anna Völkl
    Feb 27 '18 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
    Feb 28 '18 at 8:39


















2















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









share|improve this question

























  • 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.

    – Anna Völkl
    Feb 27 '18 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
    Feb 28 '18 at 8:39
















2












2








2


1






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









share|improve this question
















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






magento2 php attributes magento2.2 magento-2.2.1






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 27 '18 at 18:15









Anna Völkl

15.5k345132




15.5k345132










asked Feb 27 '18 at 17:26









sissysissy

199317




199317













  • 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.

    – Anna Völkl
    Feb 27 '18 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
    Feb 28 '18 at 8:39





















  • 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.

    – Anna Völkl
    Feb 27 '18 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
    Feb 28 '18 at 8:39



















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.

– Anna Völkl
Feb 27 '18 at 18:28





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.

– Anna Völkl
Feb 27 '18 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
Feb 28 '18 at 8:39







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
Feb 28 '18 at 8:39












2 Answers
2






active

oldest

votes


















0














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



## Add Value as required
php_value max_input_vars 6000





share|improve this answer
























  • I've tried with same but its not working for me.

    – Aasim Goriya
    Aug 9 '18 at 4:48



















0














Issue has been resolved by changing the PHP settings.



max_input_vars = 100000
max_input_nesting_level = 800
max_input_time = 18000




share























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "479"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f215308%2fphp-max-input-vars-prevents-attribute-options-saving-in-m2%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














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



    ## Add Value as required
    php_value max_input_vars 6000





    share|improve this answer
























    • I've tried with same but its not working for me.

      – Aasim Goriya
      Aug 9 '18 at 4:48
















    0














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



    ## Add Value as required
    php_value max_input_vars 6000





    share|improve this answer
























    • I've tried with same but its not working for me.

      – Aasim Goriya
      Aug 9 '18 at 4:48














    0












    0








    0







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



    ## Add Value as required
    php_value max_input_vars 6000





    share|improve this answer













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



    ## Add Value as required
    php_value max_input_vars 6000






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jun 25 '18 at 7:25









    matinictmatinict

    73011029




    73011029













    • I've tried with same but its not working for me.

      – Aasim Goriya
      Aug 9 '18 at 4:48



















    • I've tried with same but its not working for me.

      – Aasim Goriya
      Aug 9 '18 at 4:48

















    I've tried with same but its not working for me.

    – Aasim Goriya
    Aug 9 '18 at 4:48





    I've tried with same but its not working for me.

    – Aasim Goriya
    Aug 9 '18 at 4:48













    0














    Issue has been resolved by changing the PHP settings.



    max_input_vars = 100000
    max_input_nesting_level = 800
    max_input_time = 18000




    share




























      0














      Issue has been resolved by changing the PHP settings.



      max_input_vars = 100000
      max_input_nesting_level = 800
      max_input_time = 18000




      share


























        0












        0








        0







        Issue has been resolved by changing the PHP settings.



        max_input_vars = 100000
        max_input_nesting_level = 800
        max_input_time = 18000




        share













        Issue has been resolved by changing the PHP settings.



        max_input_vars = 100000
        max_input_nesting_level = 800
        max_input_time = 18000





        share











        share


        share










        answered 1 min ago









        Rakesh DongaRakesh Donga

        928




        928






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f215308%2fphp-max-input-vars-prevents-attribute-options-saving-in-m2%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Polycentropodidae

            Magento 2 Error message: Invalid state change requested

            Paulmy