max_input_vars error message
Posted by: mainwms (---.il.subnet.cable.rcn.com)
Date: November 21, 2016 07:16PM

After trying to create a page using Optimizer Themes, I am getting an error message that says:

localhost says:

ERROR: Page is not saved. You need to increase PHP variable max_input_vars to higher value. Please contact your hosting provider.

1 - Windows version used (Specify version number AND whether 32 or 64 bit)
1A - Windows 10, 64-bit

2 - Version WampServer (Specify version number AND whether 32 or 64 bit)
2A - Wampserver 2.0

3 - Apache Version
3A - Apache Version 2.2.11

4 - PHP Version
4A - PHP version 5.3.0

5 - MySQL Version
5A - MsSQL Version 5.1.36

The following is what I got from Optimizer Themes help center:

In your php.ini file you need to change the setting for the max_input_vars variable (this is usually set to around 1000). You need to change it to be 10000:

max_input_vars = 10000

This should ensure that all variables or content is saved to the database rather than only 1000 variables being passed through.

If updating through php.ini file doesn't work, then you can try creating a .user.ini file in the same directory as your wp-config.php file and add the same variable:

max_input_vars = 10000

IMPORTANT NOTE: Some hosting companies can't reach 10000 so please ask them their limits beforehand. If they can't reach 10000, ask them to go for max_input_vars = 9999 instead (see more about this at the bottom of this page).

Special Circumstances

Some hosting companies also use something called hardened PHP (Suhosin), in these cases you should also set some more variables:

suhosin.post.max_vars = 10000
suhosin.get.max_vars = 10000
suhosin.request.max_vars = 10000
suhosin.post_max_array_depth = 500
If you can get these values/settings changed on your server (normally by editing the php.ini file) this should fix the issue. Please note sometimes a server has to be restarted in order for the changes to php settings to take effect.

The following is what I did in php.ini:

; How many GET/POST/COOKIE input variables may be accepted
max_input_vars = 10000
suhosin.post.max_vars = 10000
suhosin.get.max_vars = 10000
suhosin.request.max_vars = 10000
suhosin.post_max_array_depth = 500

I still get the aforementioned error. Any assistance will be GREATLY appreciated.

NOTE: I wasn't sure how to create a .user.ini file in wp-config.php

Re: max_input_vars error message
Posted by: RiggsFolly (Moderator)
Date: November 22, 2016 01:20AM

Did you use the wampmanager menus to amend your php.ini file?

There are 2, but if you use the wampmanager menus
- wampmanager -> PHP -> php.ini

you will edit the correct one.

Also dont forget to restart Apache once the php.ini file is chnaged and saved.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Re: max_input_vars error message
Posted by: Otomatic (Moderator)
Date: November 22, 2016 09:49AM

Hi,

max_input_vars Available since PHP 5.3.9 (See [fr2.php.net])

You use 4A - PHP version 5.3.0

All versions you use: Apache, PHP, MySQL are obsolete and not supported for a long time.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Sorry, only registered users may post in this forum.