Topic: Change default php version
Hi, I'm looking for a way to change my system's default php version on a CentOS 7 server.
Actually I installed 3 different php versions (5.6, 7.1 and 7.2) and I use php-fpm to run several application with all these 3 php version, but from command line seems like 7.1 is the default one.
[root@drakaris ~]#php -version
PHP 7.1.33 (cli) (built: Jan 23 2020 09:31:19) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.1.33, Copyright (c) 1999-2018, by Zend Technologies
[root@drakaris ~]#which php
/usr/local/sbin/php
[root@drakaris ~]#ls -la /usr/local/sbin/php
lrwxrwxrwx 1 root root 28 May 3 2019 /usr/local/sbin/php -> /opt/remi/php71/root/bin/php
My objective is to make php 7.2 the default cli version.
I found this command, but from my understanding it will affect only the bash started with the command itself, and not the default php version, is it right?
scl enable php72 bash
I also found another one using module command
module load php72
Do you think this one will work and will be persistent throught system reboot and will make 7.2 the default php version for the system?
Thanks