Web & data

How to install PHP 8.0 on Linux Ubuntu and Debian

The commands to install PHP 8.0 on Ubuntu with the ondrej PPA, and on Debian with the sury.org repository, ending with the PHP-FPM package install.

· 1 min read · level: intermediate · on PHP 8.0

Update the system:

apt update

Installation on Ubuntu

apt install  ca-certificates apt-transport-https software-properties-common
add-apt-repository ppa:ondrej/php
apt update
apt install php8.0

Installation on Debian

apt install apt-transport-https lsb-release ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list
apt update
apt install php8.0
apt install php8.0-fpm