This question has been asked multiple times but non of them worked for me. I need to change my terminal's version to 7.4.
When I do phpinfo() it gives 7.4.10 but in terminal php -v it always show 5.6.0
I've done:
$ sudo a2dismod php5.6
$ sudo a2enmod php7.4
$ sudo service apache2 restart
set PATH="/usr/bin/php7.4/bin:$PATH"
sudo update-alternatives --set php /usr/bin/php7.4
sudo update-alternatives --set phar /usr/bin/phar7.4
sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.4
sudo update-alternatives --config php
This show below result:

You can use the following command in the command line:
Simply provide the desired PHP version in the above line of command.