Mueeb Bukhari's avatar

Installing php 8.1 on Ubuntu 18.04

I am using Ubuntu 18.04 and want to install PHP 8.1 but I am getting this error Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package php8.1 E: Couldn't find any package by glob 'php8.1' E: Couldn't find any package by regex 'php8.1' I tried many ways to solve it but whenever I try to install php it gives same kind of error

0 likes
4 replies
josecameselle's avatar

Update the package index:

sudo apt update

Install the required packages:

sudo apt install -y curl wget gnupg2 ca-certificates lsb-release apt-transport-https

Add ppa:ondrej repository:

sudo apt-add-repository ppa:ondrej/php

Update the package index again:

sudo apt update

Install PHP 8.1:

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

Please or to participate in this conversation.