Probably a bad idea, even for blue skies: Make it easier to have both PHP5 and PHP7 with debian

2 posts / 0 new
Last post
#1 Sun, 06/18/2017 - 09:19
OliverF

Probably a bad idea, even for blue skies: Make it easier to have both PHP5 and PHP7 with debian

Hello,

For a long time, I believed it was Virtualmin's fault that I couldn't choose to have multiple versions of PHP to choose from for virtual servers. That finally managed, eventually, to go through my thick skull, that this was actually Debian's fault, that as a principle, the distro only allows to run with one fixed PHP, thus making maintaining it simple, preventing errors and ensuring maximum security.

That said, it IS still possible, with DotDeb. Or with methods such as https://erdfisch.de/en/multiple-versions-php-apache-under-linux

And so: do you think it would be possible for Virtualmin to assist us Debian users in having several versions of PHP, both 5 and 7? Taking us by the hand, simply asking "choose which php secondary version to add: 5.5, 5.6, 5.7, 7?", and automagically doing all the work after this. (Context, if that matters: I'd love to switch to php7 some day, but a few websites I host are definitely php7-incompatible, so I'm stuck with PHP5 unless I can have multiple versions simultaneously.)

I fully realize am I asking too much here, and that, by all means, it should NOT be Virtualmin's responsibility to help with something that may make a system less stable or less secure. But, hey: maybe I'm mistaken, and it is simpler than it looks, and not risky! Operative expression being "just in case". I'm asking, just in case :)

Good day everyone!

Mon, 06/19/2017 - 16:49
Joe
Joe's picture

I was hoping to have it fully automated for the Virtualmin 6 installer, but you're right it's really quite difficult to do multiple versions cleanly on Debian. CentOS has SCL repos, which makes it easy to have two (or more) versions using a semi-official source for the packages (SCL packages aren't subject to the normal support lifecycle guidelines, but are actively maintained by Fedora, Red Hat, or CentOS contributors), and so that's already working well in the new installer.

I'm still trying to figure out the best way to do it on Debian, which is one of the reasons it's taking longer than I expected it to take (also some issues with the firewalld and fail2ban modules in Webmin that has prevented me from completing support for those features).

DotDeb, as far as I can tell, replaces the original packages, which isn't really ideal, and building from source is much worse! So, I think both of those are dead ends that we shouldn't pursue.

The best option I've found, so far, is Ondrej's packages:

https://deb.sury.org/

And, on Launchpad for Ubuntu PPA:

https://launchpad.net/~ondrej/+archive/ubuntu/php

This is, I think, the best we're gonna get for Debian and Ubuntu...so, it's likely how we'll implement it in VM6 installer. They are historically well-maintained, they can be installed alongside the OS standard packages, and they're from someone who knows what they're doing. They look very competently done, though I haven't tested in any serious way. I'm still pretty early in the process of making it work automatically. I think Eric has tinkered with these packages as well and reported good results.

If you try these packages, I'd appreciate feedback on how they work for you and any gotchas you run into. It's likely you'll need to configure Virtualmin a bit to know there are other PHP versions installed, but it shouldn't require too much effort. I'll make it automatic once I've had time to play with them and see where stuff gets installed.

--

Check out the forum guidelines!

Topic locked