Topic: Single version with php56, php71, php72 installed as SCL
Hi,
I'm running CentOS 7.5 and want to have the possibility to switch php version as needed.
I don't need different versions for different applications but rather a way to switch php version globally on the server.
Basically using Apache's mod_php.
Here are the steps I've performed:
installed the EPEL repository
installed Remi's safe repository
yum install yum-utils
yum install php56 php56-php ...
yum install php71 php71-php ...
yum install php72 php72-php ...
I didn't install php from base.
So to enable php56 for ex, I did:
module load php56
At this point both apache/web and cli versions were the same php 5.6.
When I want to switch to php72 I do the following:
module unload php56
module load php72
This is sufficient for cli version but then I need to comment the lines:
#LoadModule php5_module modules/libphp56-php5.so
and
#LoadModule php7_module modules/libphp71.so
in
/etc/httpd/conf.modules.d
Restart apache and now phpinfo(); shows php 7.2
Is this the right way of doing? I mean did I miss something?
Also do I have to install php from base or it's not mandatory?
Thanks