Install PHP 8.0 on Ubuntu server

Aneh Thakur
TrinityTuts
Published in
1 min readDec 9, 2020

PHP 8.0 is released on November 26, 2020. You can download PHP 8.0 from php.net. It’s a new major version, which means it will have some breaking change and lots of new features and performance improvement. Due to breaking change, you need to update your code to run on the latest version of PHP 8.0.

Steps to Install PHP 8.0 on Ubuntu

We need to add ondrej/php PPA as a source of packages, that contains all the latest PHP packages and their dependencies.

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

To install PHP 8.0 extensions you need to run this command

sudo apt install php8.0-common php8.0-cli -y

This command will install several PHP extensions due to php8.0-common, and the CLI for PHP 8.0.

You can check PHP Version by running this command PHP -v. To install PHP fpm run the bellow command

sudo apt install php8.0-fpm

Now with the help of the above command, your PHP 8.0 is installed successfully now you can write your code and test the latest feature of PHP 8.

Check TrinityTuts.com for more information

--

--