when I run the command php -v
I have version 8.0
I would like to change the version to 7.4
despite I have installed php7.4
but I don’t know how to switch between the two versions
thank you
Advertisement
Answer
Let’s assume that the location of php7.4 is /usr/bin/php7.4, in which case
/usr/bin/php7.4 -v
will yield something like this:
hence, you can use this method for whatever command that you would like to execute:
/usr/bin/php7.4 <yourcommand>
You can disable PHP 8 via
sudo a2dismod php8.0
if it bothers you. You can do so temporarily as well.