0

I have a fresh ubuntu server installed with virtualmin. It autoinstalls Php version 7.2, I need 7.4. So I install 7.4. When I check the version with -v it shows 7.4. However, webmin and wordpress both still see and use only 7.2. I've tried uninstalling 7.2 but the command fails and tells me that module doesn't exist when I can show it in the list of installed versions in ssh. Its just not showing up as an option in virtualmin when I go to change the php version. Only showing 7.2.

Any advice on where I should be looking to resolve this? I'm feeling stumped. Thanks!

2 Answers2

0

You can try with below command :

sudo update-alternatives --set php /usr/bin/php7.4

For more details you can refer below link as well :

https://hackthestuff.com/article/how-to-change-php-version-from-command-line-in-ubuntu

5eeker
  • 1,016
  • 1
  • 9
  • 30
  • I tried that, its still showing 7.2 in virtualmin with no option to change there. – Adam Cole Aug 23 '22 at 15:33
  • I tried just now with 8.1.9 to test and its seeing that, but not the 7.4 which is what i need. – Adam Cole Aug 23 '22 at 15:38
  • I get this when I run the configuration re-check in virtualMin but can only select 7.2 or 8.1 when I go to php options. "The following PHP execution modes are available : mod_php cgi fcgid fpm The following PHP versions are available : 7.2.34 (/usr/bin/php-cgi7.2), 8.1.9 (/usr/bin/php-cgi8.1), 7.4 (mod_php) The following PHP-FPM versions are available : 8.1.9 (php8.1-fpm) PHP versions have changed to 7.2, 7.4, 8.1 since last check. Regenerating any missing php.ini files – Adam Cole Aug 23 '22 at 15:51
0

The right way of changing PHP version for the given virtual server in Virtualmin is done using Server Configuration ⇾ PHP Options page.

Using update-alternatives command will change default PHP (CLI) version system-wide. It won't be applied to virtual-servers.

You may find our Virtualmin Community forum helpful.

Ilia Ross
  • 13,086
  • 11
  • 53
  • 88