How to Install PHP 8.0 on Ubuntu 20.04 LTS

$ sudo apt update
$ sudo apt upgrade
$ sudo apt install software-properties-common

Step 1: Add the Ondřej Surý PPA Repository

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

Step 2: Installing PHP 8.0 with

$ sudo apt install php8.0 libapache2-mod-php8.0
$ service apache2 start
$ service apache2 restart
$ service apache2 status
$ sudo apt install php8.0-fpm
$ sudo systemctl status php8.0-fpm
$ sudo systemctl restart nginx
$ php -vOutput:-PHP 8.0.0RC3 (cli) (built: Nov  27 2020 12:26:22) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.0-dev, Copyright (c) Zend Technologies
with Zend OPcache v8.0.0RC3, Copyright (c), by Zend Technologies

Step 3: Install PHP 8 Extensions on Ubuntu 20.04

apt-get install php8.0-common php8.0-mysql php8.0-xml php8.0-curl php8.0-gd php8.0-imagick php8.0-cli php8.0-dev php8.0-imap php8.0-mbstring php8.0-opcache php8.0-soap php8.0-zip -y

Step 4: Verify PHP 8 Installation on Ubuntu

$ sudo vim /var/www/html/info.php
<?php
phpinfo();
?>
$ service apache2 start     OR  $ service nginx start
$ service apache2 stop OR $ service nginx stop
$ service apache2 status OR $ service nginx status
$ service apache2 restart OR $ service nginx restart

--

--

--

Im Youtuber

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

From Open API to .Net Core on Openshift

Mac M1 Big Sur Python setup for Data Analysis

Google Cloud Platform

For people who are hunched over their desk at an office, it also relieves some of the damage

How to Screenshot a Website in C/C++

The Self-sovereign Identity Stack

PRODUCTIVITY HACKS WITH TRELLO

We Decided to Rewrite Our Software. You Won’t Believe What Happened Next!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
ve Techno

ve Techno

Im Youtuber

More from Medium

“Democratizing” is newspeak for lowering the bar

API Changelog 2022

PHP Session to React without CORS issue (or: how to solve PHP Session is changing on every request).

The Best POS Systems You Should Consider Using in 2022