How to change maximum number of POST variable in PHP?

Solution 1:

PHP 5.3.9 introduced the max_input_vars config option, which is defaulted to a value of 1000. Check out the Runtime Configuration section of the PHP manual. The default value and the change log are at the top of the page.

The value can be changed by updating the server's php.ini, adding an .htaccess file, or adding a line to httpd.conf.

Solution 2:

If you are using Suhosin with Hardened PHP, you might be hitting a maximum variables limit that it imposes. In your php.ini, you can just add

[suhosin]
suhosin.request.max_vars = 1000
suhosin.post.max_vars = 1000

changing 1000 to whatever you want and restart your webserver.

I ran into this on the Drupal Permissions page when there were a lot of modules installed with a large number of roles, which resulted in a ton of checkboxes. It would only save a certain number of them before anything after would just get ignored.

It sounds like this is probably not your problem, but since it's fairly likely that someone in the future may stumble upon this when searching for something related I'll go ahead and throw this in since it took me ages to figure out when I was stumped.