0

So, I'm on my local machine (Ubuntu 20.04) with multiple versions of PHP installed. I'm attempting to switch between 7.2 and 7.4. Here's my approach:-

$ sudo update-alternatives --config php
There are 3 choices for the alternative php (providing /usr/bin/php).

Selection Path Priority Status

0 /usr/bin/php8.0 80 auto mode 1 /usr/bin/php7.2 72 manual mode

  • 2 /usr/bin/php7.4 74 manual mode 3 /usr/bin/php8.0 80 manual mode

Press <enter> to keep the current choice[*], or type selection number:

and order a server restart:

systemctl restart apache2

Why then, back in my browser with a phpinfo() request does the system report I'm still on 7.2?

enter image description here

cookie
  • 222
  • 3
  • 8
  • 20

1 Answers1

2

Apache don't know what you want. Try this: 1st disable the php7.2 module

a2dismod php7.2

after that, enable the php7.4

a2enmod php7.4

And restart apache

systemctl restart apache2
K-attila-
  • 642