close

[Solved] Unable to install PHP 7.4 on ubantu 16.04 in apache2

Hello Guys, How are you all? Hope You all Are Fine. I am Unable to install PHP 7.4 on ubantu 16.04 in apache2 in Ubuntu 16.04 vesrion. So Here I am Explain to you all the possible solutions here.

Without Wasting your time, Lets start This Article to Solve This Error.

Why I am Unable to install PHP 7.4 on ubantu 16.04 in apache2 ?

I am trying to install PHP 7.4 on ubantu 16.04 in apache2 I am using this command.

sudo apt install -y php7.4

I get this following error :

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package php7.4
E: Couldn't find any package by glob 'php7.4'
E: Couldn't find any package by regex 'php7.4'

How To Solve Unable to install PHP 7.4 on ubantu 16.04 in apache2 Error ?

Question: How To Solve Unable to install PHP 7.4 on ubuntu 16.04 in apache2 Error?
Answer: Here Is the problem is your Ubuntu version. Actually, Ubuntu 16.04 (Xenial) is too old and Ondrej PPA only supports the Hirsute (21.04), Groovy (20.10), Focal (20.04), Bionic (18.04) operating systems. That’s why you are facing no package found. the solution is to You may roll back to your old PHP version 7.3 Here is a guide to install PHP 7.3 in ubuntu.

Solution 1

Here Is the problem is your Ubuntu version. Actually, Ubuntu 16.04 (Xenial) is too old and Ondrej PPA only supports the Hirsute (21.04), Groovy (20.10), Focal (20.04), Bionic (18.04) operating systems. That’s why you are facing no package found.

You may rollback to your old PHP version 7.3 Here is guide to install php 7.3 in ubuntu.

First of all, you need to install apache2, To install the Apache web server, run the following command on your server:

apt install apache2

After installing Apache2, use the command below to start the Apache service:

systemctl start apache2

You can always check the status of the Apache web service with this command:

systemctl status apache2

We can install PHP 7.3 with the following command:

apt install php7.3 php7.3-cli php7.3-common

To check if PHP 7.3 is installed on your server, use the command below:

php -v

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also Read

Please Rate Our Solution to Motivate Us For Give Our Best

Leave a Comment