1# php -v (default PHP version)
2
3# From PHP 8.0 to PHP 7.4:
4sudo a2dismod php8.0
5sudo a2enmod php7.4
6sudo update-alternatives --set php /usr/bin/php7.4
7sudo service apache2 restart
8
9# From PHP 7.4 to PHP 8.0:
10sudo a2dismod php7.4
11sudo a2enmod php8.0
12sudo update-alternatives --set php /usr/bin/php8.0
13sudo service apache2 restart
1$ sudo apt install python-software-properties
2$ sudo add-apt-repository ppa:ondrej/php
3