Need to install php.7.4 on Ubuntu 18. Can't get it in my list to update.

I have tried several methods, even used this tutorial:

But I can’t get any version above 7.3 is the list.

The following are the repos that have been added:

Hit:1 bionic InRelease
Hit:2 bionic-updates InRelease
Hit:3 main InRelease
Hit:4 bionic-backports InRelease
Hit:5 virtualmin-bionic InRelease
Hit:6 bionic-security InRelease
Hit:7 virtualmin-universal InRelease
Hit:8 bionic InRelease
Hit:9 bionic InRelease

What am I doing wrong?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Site Moderator
Site Moderator badge
November 25, 2023


Since PHP 7.4 might not be available in the default Ubuntu 18.04 repositories, you can add a third-party repository that has the package.

sudo apt -y install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update

Now you can install PHP 7.4 along with some common extensions that you might need.

sudo apt install php7.4

If you need additional extensions, you can install them using apt. For example, to install MySQL and GD extensions:

sudo apt install php7.4-mysql php7.4-gd

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel