[CentOS] OT:: Multiple PHP versions

Tue Dec 14 17:57:13 UTC 2021
Kenneth Porter <shiva at sewingwitch.com>

On 12/14/2021 9:38 AM, TE Dukes wrote:
> Been trying to get multiple versions of PHP on a CentOS 7 machine, off and
> on for the past couple months. I have followed 5 or 6 different howtos but
> none work. They are very similar and they seems to be done on a fresh
> install as most do an apache install is the steps. I setup two virtualhosts
> one for PHP5.6 and one for PHP 7.4. When I create a file with phpinfo, it
> reports back 5.6.xxx on both sites.

You should be using Software Collections to install additional versions:


Instead of running PHP within the Apache binary, use a proxy. I suggest 
learning how to use fcgi. Your VirtualHost could include a directive 
like this:

SetHandler "proxy:fcgi://

Install rh-php73-php-fpm (for example) with yum to run the proxy service.