Support

Account

Home Forums Search Search Results for 'max_input_vars'

Search Results for 'max_input_vars'

reply

  • besides max_input_vars there are other things that can cause this, max_input_nesting_level & max_input_time may also cause problems.

    As you say, if you move it further up it gets saved and the later ones do not. This is definitely a problem with the input not getting there and not a problem with ACF itself.

  • I actually fixed this problem myself by changing max_input_vars in php.ini

    This might not be your problem but php 5.3 has a limit of 1000 input vars. When you have a lot of fields with say the collapsible field or repeater field you will get up to over 1000 variables pretty easily. I just upped mine to 10,000 and everything is working correctly.

  • I would like to chime in.
    After YEARS of having this issue I finally found this thread.

    For me it was 39 fields, meaning ACF didn’t count past 38.
    The only way I could fix this was by manually changing values in the custom fields column.

    By adding the line
    php_value max_input_vars 3000
    to my .htaccess I was able to correct this.

    Thank you for sharing this.

  • Hube2,
    Thank you! This was the issue. There are several ways to adjust the settings for the max_input_vars via .htaccess, php.ini, etc. Although, I had to go through my actual hosting control panel (WHM) and increase the value through there – This option should be in WHM -> Service Configuration -> PHP Configuration Editor -> Advanced. It was set to 1000 so I increased it to 3000. Thank you so much for your help. I’m only wondering now if there are any security issues with this limit?

    Thank you so much!
    Jason

  • You are probably running into a PHP max_input_vars issue. This PHP setting limits the number of fields that can be submitted through a form.

  • You’ve probably guessed it, looks like a max_input_vars problem. While it looks like you only have 360 fields, when creating field groups you need to mulitply that by all the different settings that are possible for each field (id, label, name, type, instructions, etc, etc.) There are probably at least 10 fields for every field you’re creating so that turns your 360 fields into 3600 fields being sent when you hit submit.

    This max_input_vars setting can be changed in php.ini or per directory if your hosting provider allows it. http://php.net/manual/en/info.configuration.php

    Usually, it the host allow it then you can add the a line like the following to your .htaccess file

    php_value max_input_vars 5000

    Some hosting providers also allow you to place a php.ini file into the root of your site that you can use to override the global server values.

    There are also some other ways listed here that I have not used personally and have not experienced hosts that allow them: http://php.net/manual/en/configuration.changes.modes.php

    If your host does not allow you to override php values in one of these ways, I don’t think there’s much else you can do. You’re best bet is to contact your hosting provider and ask them if they provide a way to make the change.

  • Aaaaaaand I answered my own question by digging a bit deeper into your forums. I found this thread: http://support.advancedcustomfields.com/forums/topic/repeater-field-values-disappearing/

    And discovered that dropping the following into my htaccess file fixed it:

    php_value max_input_nesting_level 128
    php_value max_input_time 300
    php_value max_input_vars 3000
    php_value max_execution_time 300
    php_value post_max_size 32M

    Though I haven’t tested on my live server, only localhost, but I think that my problem was the max_input_vars thing. Yay!

  • Hi Elliot

    I think the problem was max_input_vars on the server. I’ll try again soon and let you know.

  • Then you have me stumped. The only time I’ve ever had a problem creating more fields is when I exceed max_input_vars.

    There are a couple other php settings you can try increasing:
    post_max_size
    max_input_nesting_level

  • I’m having a very similar issue. I’ve got a menu built out using a lot of custom fields and repeaters. Initially our issue in AC4 was that when you would click update it would take a long time to load then refresh and the new fields we had added would be gone. We upped max_input_vars and about every other PHP value I could think of.

    So I was hoping the upgrade would fix our saving issue, but it seems to have cropped up a different one. Now when I try to save I get the same “Uncaught TypeError: Cannot read property ‘length’ of undefined” error in load-scripts.php. This seems to go away when I delete some data / fields, but crops back up when I try to add it back in. Any suggestions?

  • You understand me correctly, I can not add more fields on the page is
    http://awesomescreenshot.com/0f635h2s43

    In the post, normally stored in all fields.

    max_input_vars 6000 Nothing has changed.
    http://awesomescreenshot.com/07635hbsb8

  • Your php setting for max_input_vars is 3000

    Look at the field group you’re creating. Each field you’re creating has many inputs there may even be a bunch of hidden inputs. If you add them all up they are most probably near your 3000 limit.

    When you submit the page to save your fields, if there are more than 3000, php simply throws away the excess, so they are not submitted to the script that needs to save your field group.

    Does your host allow you to increase that setting? I would suggest upping it to 5000 see what happens. If your host does not allow you do change that php setting then you’ll need to figure out a different way to accomplish what you want to do using less fields.

  • You are most likely running into a problem with your php installation rather than an ACF bug. PHP setting max_input_vars usually has a default value of 1000.

  • You need to alter your php ini setting max_input_vars. You’re reaching the maximum number of input fields allowed on your server.

  • Hi xanthonius,

    Might be too late, but I just had a similar issue and found this thread. For me it was caused by max_input_vars being set too low in php.ini.

    This setting controls how many variables will be accepted by PHP at once. Building a large ACF field group in the admin can require sending hundreds or thousands of variables to the server on save, so if max_input_vars is set too low and the field group you’re building is too big, your data gets truncated when you save it – in this case, probably in the middle of a conditional logic section.

    PHP documentation for the setting is at http://php.net/manual/en/info.configuration.php#ini.max-input-vars, but if you google ACF max_input_vars you’ll likely find more relevant help.

  • ok … looks like this is caused by the new default max_input_vars=1000 in php.ini. Changing that limit to 3000 solved the issue for me.

    Maybe it is possible to add a check into ACF to issue some kind of information or error if this happens?

  • Hey @jkuzma and @elliot,

    We were having this exact same issue for the last few days and it was getting extremely frustrating as things broke four days before our client site’s go-live.

    I read through all the other similar thread (ie. ‘field not saving data’) and tried the max_input_vars and memory limit fixes, to no avail.

    And then I bumped into @jkuzmas post and realized our problems has started right after we decided to stop using the admin’s template selection meta-box, but reverted back to only PHP based templating (like we’ve always done in previous projects, hence why we’ve never seen this problem before).

    So basically the problem was that the meta field _wp_page_template was set for a page, but the template didn’t exist anymore. Clear it empty, or better yet, fill it with the default phrase ‘default’, and everything works again.

    We suspect this has something to do with ACF’s location rules checks.

  • I tried creating a php.ini file containing

    php_value max_input_vars 7000

    and uploading it to my server but it ACF still won’t let me add any more fields or groups or anything…

  • Hi,

    You’re probably hitting your servers limits.. try asking your serverprovider to increase your max_input_vars

  • If you’re on a shared host its possible that your changes to max_input_vars does not apply.

    Try contacting your server supplier and ask them if they can bump it up for you 🙂 I believe 1000 is the default value which you need to increase

  • Brilliant, that did the job perfectly.

    For reference, i added:

    php_value max_input_vars 7000

    into my .htaccess file and all works now.

    thanks, Leon

  • There’s some similiar types of issues on the forum here:

    http://support.advancedcustomfields.com/forums/search/?bbp_search=max_input_vars+%3D+3000

    What solved my issue was dropping the following into the top of my WP site’s .htaccess file:

    php_value max_input_vars 7000

  • Adding php_value max_input_vars 1000 to 5000 in .htaccess helped me.
    Before that I had trouble saving fields and I could only add 7 of them.
    I too have a lot of nested fields: flexible -> repeater -> repeater.

  • After much research and much reading… I found the answer via another post on this website. I had to increase my php settings to allow more variables to be inputed.

    max_input_vars = 3000
    suhosin.post.max_vars = 3000
    suhosin.request.max_vars = 3000

    The post with the answer:

    http://support.advancedcustomfields.com/forums/search/?bbp_search=max_input_vars+%3D+3000

    Eliot, I know this issue is not related to your plugin, but just a php setting. However since it seems like a few people have already experienced the same issue, maybe you could have common solutions as this one placed somewhere easy to find in your support forum.

  • I’ve increased the value for the max_input_vars to 8000, and the problem is still not resolved. Can you give me any other direction to take?

Viewing 25 results - 126 through 150 (of 179 total)