How to increase maximum POST variable in PHP?

Anantha Krishnan picture Anantha Krishnan · Feb 22, 2012 · Viewed 119.4k times · Source

I'm using WAMP in my local machine, when a FORM(method="POST") with 2000 input fields is submitted I'm able to read only 1001 _POST variable. i.e With Netbeans debugger I can clearly see _POST size is always 1001 if there are more than 1001 input fields in the form.

I used this http://ideone.com/GAw14 java code to generate form with N input fields and tested.

The same is working fine in another machine(WAMP), where I can see all the POST variables.

Please help me to solve my problem.

Answer

lightster picture lightster · Feb 22, 2012

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.