These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for change php version via command line on the new forum.
Hi,
In Virtualmin under 'Server configuration' -> 'Php versions' I have Default HTML directory 7.0.27 empty row 5.6.36
How can I change this default 7.0.27 via command line? Of course in the interface there is no a problem but I want to do this in a script.
Kind regards
I'm not sure I fully understand what you want to achieve. But if you want to change PHP version for command line, AKA php-cli version you can use below instructions.
List all PHP versions available,
update-alternatives --list php
Then you can change the PHP version with following command,
update-alternatives --set php /usr/bin/php7.1
Source: Use Multiple PHP Versions With Virtualmin
I provide FREE Server Management Services in exchange of money
Hello, I think I have same problem. I have installed tree different PHP version two versions (5.4.10 and 7.0.27) already came preinstalled, 3rd that I have installed 7.2.10 using yum rh-php72-php with other components. The problem is when I use command line somehow it uses another version of PHP and not 7.2.10. I know that 7.2.10 works because using Magento web installer it allowed me to install newest 2.3 version. By this post https://vpsfix.com/7091/multiple-php-versions-virtualmin-nginx/ with this command: update-alternatives --set php /usr/bin/php7.2 it should fix the problem, but using command “update-alternatives –list” does not show any PHP version. For now, only other option I have is to remove 5.4.10 and 7.0.27 versions and only keep 7.2.10
CentOS 7 64bit with Webmin/Wirtualmin/LAMP on VPS