Verification Multiple PHP version on Virtualmin

OS type and version DEBIAN 10
Webmin version 1.984
Virtualmin version 6.17-3

Apache/2.4.38, PHP : 7.3.31-1~deb10u1


I would like a confirmation from the Virtualmin team, is the procedure at this address (Multiple PHP Versions – Virtualmin) safe. I would like to put the multi PHP on a production server but before that I would like to be sure that this procedure will work without bad surprises.
The server has been installed with virtualmin, no other third party software installed.

For Debian, it is recommended to do this:

Enable the repository

apt-get -y install apt-transport-https lsb-release ca-certificates curl
curl -sSL -o /etc/apt/trusted.gpg.d/php.gpg
sh -c 'echo "deb $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'

Update all repositories

apt update

Install PHP packages version 5.6 and/or 7.4 and/or 8.0

apt-get install php5.6-{cli,pdo,fpm,zip,gd,xml,mysql,cgi}
apt-get install php7.4-{cli,pdo,fpm,zip,gd,xml,mysql,cgi}
apt-get install php8.0-{cli,pdo,fpm,zip,gd,xml,mysql,cgi}

Thanks for your precious help.

Yup, that link is part of the official documentation for Virtualmin and we all use it without too many bad surprises. Joe had mentioned in a recent post that ideally there should be only one currently supported version of PHP on a system (depending on the apps that are hosted) but if you must have multiple versions of PHP, that’s the document to follow.

Hello Calport,

Thank you for your feedback.
I will try this weekend and hope that everything goes well.

In case of problem, is there a possibility to go back without having to reinstall the whole server (that would be dramatic for me)?

And just in case, is virtualmin going to update PHP 7.3 to 7.4 soon ? because 7.3 has no more support

Thank you.


People seem to think it’s Virtualmin’s responsibility to upgrade core software. The fact is, Virtualmin is software itself, and while it can support multiple versions of PHP for instance, the job of upgrading versions either lies on the user (you) or distribution (CentOS, Ubuntu, etc).

So if you want a newer version then 7.3, feel free to find a mirror and upgrade to it.

1 Like

Hello tpnsolutions

That’s what I intend to do.

I ask because I use Virtualmin since Debian 7 and the PHP versions have been proposed in automatic via Virtualmin in the “Software packages updates” section.

I have never done a manual PHP update, hence my questions and fears. A little caution avoids spending a weekend rebuilding a server.

Really? Installing Virtualmin takes 10 seconds plus the time it takes to brew and drink a cup of coffee. And transferring virtual servers from one Virtualmin box to another is a breeze, so where do you anticipate the drama?

In the early days of the net people had one server and every operation on it, be it a software install or an update, had an element of risk and drama. If things went majorly wrong with the install, then the hard disk had to be formatted and the OS and server reinstalled and backups restored, because all that most people could afford in those days was one singleton physical server.

Today, with Virtualmin and readily available low cost cloud servers, just spin up one more and move virtual servers around as much as you want. There will be drama only if the old singleton server philosophy is still clung to, else one could zip, zam and zoom vps’, Virtualmin and virtual servers in various test, staging and production environments without breaking a sweat.



Another point to make regarding “software versions” is that distros like Debian, and RedHat focus their attention on “security” and “stability”.

This focus allows them to provide an “enterprise grade” environment with few if issues during it’s lifecycle.

I know for a fact that RedHat distro’s take “latest patches” found in newer versions of software and do what is referred to as a “backport” meaning if that bug addresses something in an older version of the product they’ll literally apply the fix to the older version of the software without introducing “new features” which might break things.

Distros like Ubuntu (based on Debian), Fedora (based on RedHat) offer a bit more flexibility in design by offering newer (less tested) versions of software. In my experience Ubuntu given they are backed by a commercial entity (like RedHat) and offer the same core software to both paid and free customers, even though they release software more frequently they’re also pretty quick at patching bugs found within.

Even so, ever major distro generally will NOT release the latest version of a software title before it has vetted that the new version doesn’t have serious bugs, and won’t introduce issues with the rest of their distro.

The bottom line, when installing new versions of software, it is a good idea to do your own vetting to ensure that version will work as intended and not create other problems.

Final point, I usually give each major software release at least 3 - 6 months before making any major commitments to it, also ensuring that other software I rely on (including Virtualmin) have caught up and can properly support the new version.

In the old way, I have a dedicated server with Debian 10 on which I install Virtualmin via the script provided by Virtualmin.
I’m self-taught, I learn every day and that’s what I like.
I haven’t done all the features yet, I do my full backups through Virtualmin, every day locally and on a remote.
But as curious as it is, I never used the restore feature because every time my installation crashed I took the opportunity to upgrade to the next Debian version.

Since you know the subject, can you tell me if a backup under Debian 10 can be restored under Debian 11 without difficulty?

Thanks for the link, I’ll have a look at it at my leisure.

I share your opinion, otherwise I would already be using debian 11 as soon as it is released. But as long as I’m not sure that everything is ok with Debian 11 and Virtualmin, I won’t move.
Because if I don’t say anything wrong, it’s PHP 8 that installs with Debian 11 and I have too much uncertainty about the good working of my applications in PHP 8.
I don’t want to relive the transition from PHP 5.6 to PHP 7.0 = an ordeal at my little level.

Thanks to both of you for your advice.

Yep, not many apps tuned for PHP8. I downgraded a while back. Just a personal preference but I would use PHP7.4 and scripts needing PHP5.6 - I would think twice why this is needed at all. I would probably ask/check if alternative service could use 7.4PHP. You may have specific requirements to have multiple versions. For me, simplicity wins every time but agree legacy is not always easy to deal with.

Thanks for this information, I will stay on Debian 10 and PHP 7.4
I just have to master the Virtualmin restoration.

Just to add. When you backup using Virtualmin. Backup everything, tick the additional boxes to include extras. However, when you restore a domain/account - leave apache configs/ don’t overwrite. I was on CentOS so not sure if Debian does thing differently but for me restoring apache files messed up a lot. I scratched my bald head so many times I started to grow ginger hair. Another error was a module enabled on old server versus new which did not have this module and restore failed. Once I updated server like for like it was fine.

My point being with the restore, a bit of trial and error and don’t get put off/frustrated if things don’t work as expected. Mostly it can be resolved. Take notice of the restore options as not everything may be applicable and can cause config conflicts.

Thanks Woops, for sharing your experience.
I’ve got it. I just hope I can restore it one weekend.

Actually, Debian 11 comes with 7.4.

But as others mentioned, the instructions in the documentation are perfectly OK and does not mess up the system in any way. So you can safely go with those, or just wait a few more days™ until the Virtualmin releases version 7 with full support for Deb11 and upgrade from 10 → 11 then :slight_smile:

1 Like

Things get iffy when a backup taken under one version of the OS is restored under another version of the OS because the underlying software like web server and database server might be of different versions which may have minor incompatibility.

The workaround is to do as @Whoops suggests and during restore:

  1. create the virtual server on the destination manually
  2. Check only those boxes of Virtualmin restore that are related to web, email and database

I have found (and Whoops concurs) that this provides the greatest chance of an error-free restore across different versions of OSs. If the version of the OS is the same on the source server and destination server then all the boxes can be kept checked and the restore will be carried out perfectly, for sure.

I fear I have wandered off-topic in my enthusiasm. Let’s start a new topic if we are to continue discussing backup.

Thanks Toreskev.
Thank you very much for sharing your experience and for your time to solve my problem.

Indeed the above lines work correctly, see the result below:

I will open a new post on Backup/Restore as soon as I start using it.

Thanks again to all of you for your participation and involvement.

Have a nice day.

1 Like

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