Failed to save PHP options : Apache virtual host was not found

SYSTEM INFORMATION
OS type and version: Ubuntu 20.04
Webmin version: 1.973
Virtualmin version: 6.15

New Ubuntu server, moving web sites from an older Virtualmin server via Virtualmin backup and restore. This server is an archive of old “annual” sites, so there are a lot of similar ones. The new server uses FPM, the old one used FCGId. I had a certain set of sites migrated successfully, everything on those WAS working. All sites were using wildcarded IP addresses (*), and on restore I selected the option to use the old IP address, then changed the php mode to FPM. All was good on the first set.

The second set caused trouble though. On restore, Virtualmin complained about FPM being unable to restart. Using systemctl status I found that a group was specified that didn’t exist (nor did it exist on the old server, but that wasn’t using FPM). I changed the group in the pool file, but then on updating the mode page, I get:

Failed to save PHP options : Apache virtual host was not found

Figuring that something was screwed up with the sites because of the FPM failure, I deleted the 2nd set of sites. I then went to one of the other sites in the first set to try updating FPM and it ALSO gives that error.

Googling, I see that “wrong” ports (and IP addresses?) can prevent a site from being found (they definitely exist!) so I ran Re-Check Config, still got the error, then tried specifying the current IP address for the site. Still get the same error. More googling, and I see a recommendation to disable and then re-enable the site. Still get the same error.

How can I fix this?

Also,I tried virtualmin validate-domains --all-domains --feature web and it reports All features OK for every site.

I have found that changing the php option to FCGId, saving, then changing it back to FPM allows the virtual host to be “found” again.

Hmmm, changing the php execution mode does indeed seem to work.

But if I got back to that page and simply select Save (without changing anything) I still get the

Failed to save PHP options : Apache virtual host was not found

So maybe this error message is an error itself? “failed to save” is because there’s nothing changed to save, and “Apache virtual host was not found” is the wrong reason there was no save?

The status of your system is being checked to ensure that all enabled features are available, that the mail server is properly configured, and that quotas are active …

Your system has 11.73 GB of memory, which is at or above the Virtualmin recommended minimum of 256 MB. ![blank|23x20](upload://bqpGriz8ggELxxrO26M56Lh6N3D.png)


Apache is installed.

The following PHP versions are available : 7.0.8 (/usr/bin/php5-cgi), 7.0.8 (/usr/bin/php-cgi7.0)

PHP versions have changed to 5, 7.0 since last check. Regenerating any missing php.ini files.

Apache virtual host was not found