• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved How to increase max_input_vars in a WordPress subfolder

meymigrou

New Pleskian
Server operating system version
Debian 10.13
Plesk version and microupdate number
Plesk Obsidian Version 18.0.51 Update #1
Hello everyone,

I have a WordPress blog that has 4 subfolders with other WordPress installations. I added everything to WordPress Multisite and configured the CMS platform to see all installations. The only problem that I am facing is that subfolders have different PHP settings than the main website.

For example, the main website has max_input_vars set at 5000, while subfolders have max_input_vars set to 200. The same goes for memory_limit, upload_limit etc. The problem is that I am using a theme in one specific subfolder that needs max_input_vars to be set at 5000, and I don't know how to change that for that specific subfolder in order to make it work.

I've tried adding code to wp-config.php, htaccess, and php.ini and nothing worked. I've also changed the PHP settings from the main website using Plesk and increased the max_input_vars by placing "max_input_vars = 6000" at the "Additional configuration directives" in Plesk, but that didn't solve the problem either.

Any idea on how to increase the max_imput_vars in a subfolder running WordPress?
 
@meymigrou The correct solution would be to add "max_input_vars = n" to the "additional configuration directives" on the PHP settings page of the affected domain or subdomain. As you say it did not work, could you please describe in more detail what your understanding of a "subfolder" is? Each Wordpress installation should be in their own document root folder of a domain or subdomain. So it should be easy to set individual PHP configurations for such websites. Is that the configuration you have in your system?
 
Adding f.ex. this to a .htaccess does not work?
php_value max_input_vars 6000

This is giving the page a "500 Internal Server Error", saying "The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator to inform of the time the error occurred and of anything you might have done that may have caused the error. More information about this error may be available in the server error log."

@meymigrou The correct solution would be to add "max_input_vars = n" to the "additional configuration directives" on the PHP settings page of the affected domain or subdomain. As you say it did not work, could you please describe in more detail what your understanding of a "subfolder" is? Each Wordpress installation should be in their own document root folder of a domain or subdomain. So it should be easy to set individual PHP configurations for such websites. Is that the configuration you have in your system?

I have a main folder called example.com which includes 4 different folders with WordPress installations.

- Example.com
- Example.com/tech
- Example.com/food
- Exampe.com/entertainment

And so on. Now the main website already has php_value max_input_vars set at 6000, but the subfolder installations don't have the same number, and I am trying to find a way to change that. Maybe there's a file I didn't checked? A setting in Plesk that handles subfolders?
 
The setting does not depend on a folder, but on the domain. If in a website the setting is different, that website sets it via php ini settings, such as ini_set() function. Such a function in a script overrides the PHP preset.
 
The setting does not depend on a folder, but on the domain. If in a website the setting is different, that website sets it via php ini settings, such as ini_set() function. Such a function in a script overrides the PHP preset.
I've checked for a php.ini file and it wasn't there for any of my subfolders. I have created one and placed the "max_input_vars = 6000" inside it and saved it. It didn't change the max_input_vars in my subfolder installation. Placing a similar code to .htacess files gives a 500 Internal Server error. Any other ideas on how to increase it for my subfolders?
 
Placing a similar code to .htacess files gives a 500 Internal Server error.
You'll need use the right format when adding PHP configuration to a htacess file. Which in this case would be: php_value max_input_vars 6000

However, if the max_input_vars variable is also is configured in your website with ini_set(), it will take president over any setting configured in a htacess file.
 
I have found the solution; It seems there was some code in the user.ini file on my main website which had max_input_vars set to 2000. I've changed it to 6000 and it works like a charm. Thank you for your kind help!
 
Back
Top