Home Forums Backend Issues (wp-admin) PHP: Input variables exceeded 1000


PHP: Input variables exceeded 1000

  • While trying to edit a field group, I noticed that my changes were not being saved. When I looked at the web server logs I saw entries like this…

    AH01071: Got error 'PHP message: PHP Warning: Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. in Unknown on line 0\n'

    So I enabled the developer tools on my web browser and examined the contents of the post. Sure enough, there was easily over 1000 variables being posted (it is a field group with a lot of stuff in it).

    Server setup:

    • Debian 9
    • WordPress – Version 4.9.8
    • PHP 7.0 FPM
    • Advanced Custom Fields – Version 4.4.12
    • Advanced Custom Fields: Flexible Content Field – Version 2.1.0 (w/valid license)
    • Advanced Custom Fields: Repeater Field – Version 2.1.0 (w/valid license)

    Conditions causing the bug:

    • The problem occurs when trying to add a new location rule to a field group using a single flexible content field.
    • The flexible content field had 12 layouts, with a total of 37 sub-fields among them.
    • The field group had 6 Location rules.
    • 8 ‘Hide on Screen’ items were checkmarked
    • This setup had been working in the past on the same server, with the same configurations files.
    • Trying to add a new location rule resulted in the last 3 layouts (along with their 7 sub-fields) being deleted. The new rule also was not saved. And the last field of the last surviving layout was deleted, as well as some settings of the second to last sub-field.

    Temporary work-around:
    I bumped the php.ini variable ‘max_input_vars’ up to 2000, restarted apache, reconstructed the field group and was able to save it. So too many form variables being submitted at once is definitely causing the problem. Luckily, everything that used that field group was restored to normal operation after reconstructing the field group. Then I returned ‘max_input_vars’ to its default value of 1000 and restarted apache again to prevent attackers from trying to abuse GET and POST requests.

    Suggested solution:
    It is my understanding that WordPress is moving toward using its REST-API for all screens in the admin area. Maybe now is a good time to start converting ACF to submit all data from the field group editor as a single JSON data string. This would avoid triggering the default 1000 input variable setting on apache.

  • As far as I know the only solution currently is to increase max_input_vars and leave it.

    The developer may focus on this in the future, but I don’t have this information. The best way for you to get his attention is here

  • Yes, I figured out later that the developers don’t really follow this forum, so I filled out a trouble ticket with my suggestion solution. The answer i got back was that the person answering the trouble ticket would pass my JSON data idea on to the developers.

  • Hope this helps others, but for every WP site I set max_input_vars to 5000. Since then I have run dozens of sites and some with massive amounts of repeaters and other fields. So far I have not run into this issue again.
    You can do this with Apache or Nginx (Whatever web server you are using) or PHP.ini.

  • The developer took my advice. All versions since 5.0 no longer have this problem.

    You can change your max_input_vars setting back to the default value of 1000, and ACF will work fine with large field sets.

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘PHP: Input variables exceeded 1000’ is closed to new replies.