Add PHP 5.6 to C8 - multiple php versions in virtualmin

Operating system: CENTOS
OS version: 8
My default installation had only PHP 7.2 installed. I have some older website’s still using 5.6 and will not work in php 7.2. I therefore installed PHP 5.6 via Remi’s wizard:
https://rpms.remirepo.net/wizard/
This worked OK, I rebooted and in virtualmin it still seems only version 7.2 is available. How do I get the 5.6 version into virtualmin so I can apply it to the older websites who need it? Many thanks for any direction here.

As a first step after you install PHP 5.6, you should run Recheck Configuration and this will likely solve your problem.

If not, let us know and we will dig deeper.

Take a look at the official documentation for multiple PHP versions.

2 Likes

@whirlweb,

PHP 5 has been EOL for quite some time. You really should spend the time fixing your website to work with at least PHP 7 instead of trying to install an out of date version of PHP which will receive absolutely NO support and likely acquire plenty of bugs and exploits… If you are okay with your server being hacked due to having EOL software on it, then well… Good luck.

I suspect most of your compatibility issues could be resolved in a day if you put some time into updating the code while reviewing the error logs to see what is broken or unsupported in PHP 7.

Best Regards,
Peter Knowles | TPN Solutions

1 Like

Hi, I ran that and this came back:

The following PHP versions are available : 5.6.40 (/bin/php56-cgi), 7.2.24 (/bin/php-cgi)

The following PHP-FPM versions are available on this system : 7.2.24 (php-fpm)

The following PHP execution modes are available : fpm

I couldnt see however how to change php 7 to php 5.6 . In a previous virtualmin server I had a “PHP Version” section but in this one I see only “PHP Options” section which doesnt allow selecting other veersions of PHP. Any direction would be appreciated, thanks.

From the snippet you have provided it appears that only PHP 7.2 is available on PHP-FPM. If you wish to see multiple versions of PHP then you must enable PHP-FPM for 5.6 too.

Or you can use 5.6 without PHP-FPM. That’s possible too without your needing to install anything else.

You have received valuable feedback from the community. @toreskev has pointed you to a link which outlines the official way to install multiple versions of PHP on Virtualmin. @tpnsolutions has cautioned about the pitfalls of legacy PHP.

You must find a balance between suport for legacy components and securing your server.

1 Like

Ok thanks, so to enable PHP-FPM 5.6 is that just enabling it or downloading. Is there a simple procedure as i just googled it and it talkes about compiling libraries etc which I’m unsure about. Thanks.

Oh, it is quite simple to add PHP-FPM for PHP 5.6 and @toreskev has already provided you with a link with the info you need to proceed.

Ok thanks for the pointers, I found the info at Remi's RPM repository . Thanks again guys.

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