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 ?

  1. Unable to install PHP 7.4 on ubantu 16.04 in apache2

    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.

  2. How To Solve Unable to install PHP 7.4 on ubuntu 16.04 in apache2 Error?

    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: rollback to your old PHP version 7.3

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

Solution 2: Use 3rd party repository

Use 3rd party repository. Just use this command.

sudo add-apt-repository ppa:jczaplicki/xenial-php74-temp

Then run this command.

sudo apt-get update

Solution 3: update os to at least 18.04

Here Ubuntu 16.04 is not supported anymore. Ondrej PPA supports only versions of Ubuntu (and php) which are still supported. Standard Support for 16.04 ran out in April 2021, since then you probably did not get any php7.3 updates. So that You just need to update atleast 18.04 you should be fine installing any php version >= 7.3.

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

Leave a Comment