sudo apt install software-properties-common

sudo add-apt-repository ppa:ondrej/php

sudo apt install php8.0 libapache2-mod-php8.0

sudo systemctl restart apache2

php -v