# source : https://linuxize.com/post/how-to-install-php-8-on-ubuntu-20-04/ # Enableging the PHP Repo sudo apt install software-properties-common sudo add-apt-repository ppa:ondrej/php # Nginx cconfig to specify which php fpm sock to use. /etc/nginx/sites-enabled/site.local fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; fastcgi_pass unix:/var/run/php/php8.0-fpm.sock; # Show installed php packages dpkg --get-selections | grep php # Install PHP 8.0-fpm and extensions sudo apt install php8.0-fpm php8.0-mysql php8.0-gd php8.0-mbstring php8.0-curl php8.0-dom php8.0-imagick systemctl status php8.0-fpm sudo systemctl restart nginx sudo systemctl restart php8.0-fpm # set default cli on ubuntu # Source: https://stackoverflow.com/questions/42619312/switch-php-versions-on-commandline-ubuntu-16-04 sudo update-alternatives --set php /usr/bin/php8.0