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

max_input_vars = 4000

And don’t forget to restart apache.

You can also edit it in your .htaccess file

 php_value max_input_vars 4000 

Change it directly in your php file with this

 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)

suhosin.get.max_vars = 4000 = 4000 
suhosin.request.max_vars = 4000 

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

echo ini_get('');