Changed max_input_vars but no effect

I am attempting to use a directory wordpress theme on my DigitalOcean Ubuntu 16.04. I am a novice at best when it comes to virtualmin.

I have installed and am running Virtualmin/webmin without issue up to now (I have multiple websites where I installed Wordpress using the script installer built into Virtualmin)

However when I install this theme it says that my max_input_vars is set too low. It shows the current setting as “1000” and says it needs to be set at “3000” for the theme to work correctly.

I did some research and found out that you go

Services > PHP 7.0 Configuration > Edit Configuration Manually > change max_input_vars to 3000 from 1000, save, restart apache and boom, all is good.

Just to be safe, I made it 5000.

HOWEVER the theme still isn’t working correctly and the “system report” the theme provides still shows the max_input_vars as 1000 instead of the 5000 I set it to.

Here is a screenshot of the “system report” the theme is giving me

  1. removed 2) removed

and just so you know I’m not crazy here is a screenshot of php.ini manual edit removed

I even went in via FTP and checked /etc/php/7.0/cgif AND /home/url/etc/php7.0/php.ini and both show max_input_vars as 5000.

I am pulling my hair out here. Is there somewhere else I need to change this? Is it pulling from another php.ini file I don’t know about?

I read a comment that said something about Virtualmin having 3 places you need to change the php.ini default settings but I couldn’t find any other mention of it.

Any help would be greatly appreciated!

Howdy,

Where I’d start, is to create a script named “test.php” in this domain’s public_html folder, and give it the following contents:

<?php phpinfo(); ?>

Would it be possible to either share that output with us, or share the resulting URL?

-Eric

Here is the link to the “test.php” page removed.

It still says max_input_vars = 1000. So I’m assuming there is a unique .ini file its pulling from? Again, I’ve never dealt with this before so apologies if I’m being dense/missing the obvious here.

UPDATE: issue is fixed, turns out I did not remove the “;” before the "max_input_vars’ in my .ini file.

Thanks for the help everyone!

For those facing the same challenge, if removing the “;” did not resolve it. Choose one of the two options below. Either FCGId or FPM. Which one option you need to choose depend on which PHP script execution mode you are presently using. Steps to know which PHP script execution mode you’re presently using:

  1. Using Virtualmin, using the drop down menu, select the appropriate Virtual Server
  2. Navigate to “Server Configuration -> Website Options -> PHP script execution mode” row.
  3. If you are not familiar with those PHP script execution mode options and which one to choose, find the “Comparison FPM & mod_php” section below.

After the steps above are done, choose one of the following two options:

Option 1: FCGId

  1. Using Virtualmin, using the drop down menu, select the appropriate Virtual Server
  2. Navigate to “Services -> PHP5 Configuration -> Edit Configuration”
  3. Add this line. Within this line, adapt the “10000” number appropriately:
    max_input_vars=10000
  4. Restart Apache server. One way to restart Apache is on Virtualmin Dashboard, under “Servers Status” section, next to the “Apache Webserver” row, click on the blue “Restart Apache” button.

Option 2: FPM

  1. Using Virtualmin, using the drop down menu, select the appropriate Virtual Server
  2. Navigate to “Services -> PHP-FPM Configuration -> Edit Configuration”
  3. Add this line. Within this line, adapt the “10000” number appropriately:
    max_input_vars=10000
  4. Restart PHP-FPM server. One way to restart PHP-FPM server is on Virtualmin Dashboard, under “Servers Status” section, next to the appropriate “PHP-FPM Server” row, click on the blue “Restart PHP-FPM Server” button.

Remove ";"

For both options above, double check that there is no “;” before the “max_input_vars=10000” line. Because “;” means commented out. In other words, the whole line is ignored.

Comparison FPM & mod_php

FPM is also known as PHP-FPM

If possible, and if not already done, now is a good time to let go of mod_php. I suggest to use FPM instead of mod_php. Because:

  • FPM is more recent than both FCGId or mod_php
  • FPM is up to 350 times faster than mod_php if configure properly
  • FPM is maintained along side PHP core. So likely more secure and faster fixes and updates, no more messing around with suphp or suexec, or mod_php.
  • FPM has a smaller memory footprint than mod_php
  • FPM has more configuration options than FastCGI. Those are optional, but available & handy if needed.
  • FPM is able to gracefully stop and start PHP worker processes without losing any queries

If somehow you do not have access to FPM (PHP-FPM), as second choice I suggest FCGId

Attributions

Thanks to the Ubertus team for their contribution with the steps above. And thanks to andreychek for his contribution at https://www.virtualmin.com/comment/604435#comment-604435