Change PHP version of all servers

SYSTEM INFORMATION
OS type and version: Ubuntu 18.04
Webmin version: 1.981
Virtualmin version: 6.17-3
Related products version: PHP 7.2 and PHP 8.0

My Ubuntu came with PHP 7.2. I’ve installed PHP 8.0 and tested a couple servers with it and everything is working fine. Now I need to switch all servers using 7.2 to use 8.0. Is there an easier way of doing it besides manual which will take days for me?

The execution mode is FPM if it’s relevant. I’ve already setup the Server templates to use 8.0 on future servers.

I’ve needed to tweak settings in a similar fashion and this helped a lot.

Changes web server settings for one or more domains.

virtualmin modify-web --domain name | --all-domains
                     [--mode mod_php|cgi|fcgid|fpm | --default-mode]
                     [--php-children number | --no-php-children]
                     [--php-version num]
                     [--php-timeout seconds | --no-php-timeout]
                     [--php-fpm-port | --php-fpm-socket]
                     [--proxy http://... | --no-proxy]
                     [--framefwd http://... | --no-framefwd]
                     [--frametitle "title" ]
                     [--webmail | --no-webmail]
                     [--matchall | --no-matchall]
                     [--includes extension | --no-includes]
                     [--default-website]
                     [--access-log log-path]
                     [--error-log log-path]
                     [--document-dir subdirectory |
                      --move-document-dir subdirectory |
                      --fix-document-dir]
                     [--port number] [--ssl-port number]
                     [--url-port number] [--ssl-url-port number]
                     [--fix-options]
                     [--letsencrypt-renew | --no-letsencrypt-renew]
                     [--break-ssl-cert | --link-ssl-cert]
                     [--sync-tlsa]

Do testing on your own please one one server or something like that, but this should help.

You can also use –all-domains option and it does the job.

2 Likes

That worked well. And this command is awesome. I’ll bookmark this.

Thanks

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.