I'm getting a max_input_vars
error message.
I understand there's a php.ini
setting that can change this starting with version 5.3.9 however, I'm running version 5.1.6.
When I view the configuration information for my 5.1.6 server it shows max_input_vars
value is 1000.
My question is: Even though I'm running 5.1.6, I see this setting from phpinfo()
but it's not in the php.ini
file. Does this mean that the value is hard coded in this version of PHP and can't be changed?
The PHP variable max_input_vars was introduced in PHP 5.3. 9+ as a security measure to limit the maximum amount of POST variables submitted. It represents the number of variables your server can use to run a function. If the value of PHP input vars is not enough, you will get the max_input_vars error.
If you created your own PHP. ini file, then add the same code inside it: max_input_vars = 5000 Simply change the value to the recommended value. For example, 5000. Save your changes, and reboot your localhost or your server.
Max Input Vars can easily get increased by using a line of code. PHP max input vars is simply the number of variables your server is set to handle in each function. If you receive the error 'Increase PHP Max Input Vars Limit' in WordPress, you need to add the code 'php_value max_input_vars 3000' to your .
Reference on PHP net:
http://php.net/manual/en/info.configuration.php#ini.max-input-vars
Please note, you cannot set this directive in run-time with function ini_set(name, newValue)
, e.g.
ini_set('max_input_vars', 3000);
It will not work.
As explained in documentation, this directive may only be set per directory scope, which means via .htaccess file, httpd.conf or .user.ini (since PHP 5.3).
See http://php.net/manual/en/configuration.changes.modes.php
Adding the directive into php.ini or placing following lines into .htaccess will work:
php_value max_input_vars 3000 php_value suhosin.get.max_vars 3000 php_value suhosin.post.max_vars 3000 php_value suhosin.request.max_vars 3000
You can add it to php.ini and it should work - just tested it on PHP 5.3.6.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With