PHP is a scripting language that runs on Windows, Linux, Unix, Mac OS X. You can install PHP 8 on Pop!_OS as easily as you complete this article. To top it all PHP is compatible with all the servers used today. As at the time this article is being published, the latest is PHP is PHP 8. Follow the step by step guide below and you will successfully install PHP 8 on Pop!_OS.

Install PHP 8 on Pop!_OS

Before the installation process begins, there are a few things you need to do, a system update/upgrade and then install the latest PPA repository. All are as shown below;

Step 1. Do an APT index update on Pop!_OS

To do so use the following command;

sudo apt update
sudo apt upgrade

Once this is done, ensure that you reboot your system with;

sudo systemctl reboot

Step 2. Add Ondřej Surý PPA repository

To get the latest PPA repository, head over to Ondřej Surý PPA repository. To do so, use the following command;

sudo apt install lsb-release ca-certificates apt-transport-https software-properties-common -y

This is the output;

[email protected]:~$ sudo apt install lsb-release ca-certificates apt-transport-https software-properties-common -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
lsb-release is already the newest version (11.1.0ubuntu2).
ca-certificates is already the newest version (20210119~20.10.1).
software-properties-common is already the newest version (0.99.3.1).
The following NEW packages will be installed:
  apt-transport-https
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,708 B of archives.
After this operation, 164 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu groovy-updates/universe amd64 apt-transport-https all 2.1.10ubuntu0.3 [1,708 B]
Fetched 1,708 B in 3s (655 B/s)          
Selecting previously unselected package apt-transport-https.
(Reading database ... 255485 files and directories currently installed.)
Preparing to unpack .../apt-transport-https_2.1.10ubuntu0.3_all.deb ...
Unpacking apt-transport-https (2.1.10ubuntu0.3) ...
Setting up apt-transport-https (2.1.10ubuntu0.3) ...

Then add the repository

sudo add-apt-repository ppa:ondrej/php

Step 3. Install PHP 8 on Pop!_OS

The first step here is to update the apt index;

sudo apt update

Then install Php 8 on Pop!_OS using the following command;

 sudo apt install php8.0

Below is a part of the output;

[email protected]:~$  sudo apt install php8.0
[sudo] password for cheronohvalentine: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  apache2 apache2-bin apache2-data apache2-utils libapache2-mod-php8.0 libapr1
  libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap php-common php8.0-cli
  php8.0-common php8.0-opcache php8.0-readline
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom php-pear
The following NEW packages will be installed:
  apache2 apache2-bin apache2-data apache2-utils libapache2-mod-php8.0 libapr1
  libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap php-common php8.0
  php8.0-cli php8.0-common php8.0-opcache php8.0-readline
0 upgraded, 15 newly installed, 0 to remove and 12 not upgraded.
Need to get 6,176 kB of archives.
After this operation, 27.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ppa.launchpad.net/ondrej/php/ubuntu groovy/main amd64 php-common all 2:82+ubuntu20.10.1+deb.sury.org+1 [17.6 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu groovy/main amd64 libapr1 amd64 1.6.5-1ubuntu1 [91.4 kB]

Step 4. Check if PHP 8 has been installed successfully and the version installed

To do so, use the following command;

php -v

The output;

[email protected]:~$ php -v
PHP 8.0.5 (cli) (built: May  3 2021 11:31:15) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.5, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.5, Copyright (c), by Zend Technologies

The output above shows that PHP 8 was successfully installed.

You can also install PHP 8 extensions on Pop!_OS using the following command;

sudo apt install php8.0-<extension>

Wrap Up

Just as shown above, you get to install PHP 8 on Pop!_OS easily, all you have to do is follow the above steps and you will be done in no time.

Other articles on Pop!_OS

LEAVE A REPLY

Please enter your comment!
Please enter your name here