PHP form limited to 1000 fields

Since PHP 5.3.9 form are limited to 1000 fields by default.
To fix it, you can edit your php.ini file and modify this variable

1
max_input_vars = 4000

And don’t forget to restart apache.

You can also edit it in your .htaccess file

1
php_value max_input_vars 4000

Change it directly in your php file with this

1
ini_set('php_value max_input_vars', 4000);

won’t work.

But change this varible may not fix your issue.
If you have suhosin installed, you laso have to edit his configuration file (/etc/php5/apache2/conf.d/suhosin.ini)

1
2
3
suhosin.get.max_vars = 4000
suhosin.post.max_vars = 4000
suhosin.request.max_vars = 4000

To check your suhison configuration, use phpinfo() or in your php script

1
echo ini_get('suhosin.post.max_vars');

Leave a Reply