Report this

What is the reason for this report?

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

Posted on November 23, 2023

I have tried several methods, even used this tutorial:

https://www.digitalocean.com/community/tutorials/how-to-install-php-7-4-and-set-up-a-local-development-environment-on-ubuntu-18-04

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

The following are the repos that have been added:

Hit:1 http://mirrors.digitalocean.com/ubuntu bionic InRelease
Hit:2 http://mirrors.digitalocean.com/ubuntu bionic-updates InRelease
Hit:3 https://repos.insights.digitalocean.com/apt/do-agent main InRelease
Hit:4 http://mirrors.digitalocean.com/ubuntu bionic-backports InRelease
Hit:5 http://software.virtualmin.com/vm/6/gpl/apt virtualmin-bionic InRelease
Hit:6 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:7 http://software.virtualmin.com/vm/6/gpl/apt virtualmin-universal InRelease
Hit:8 http://ppa.launchpad.net/ondrej/apache2/ubuntu bionic InRelease
Hit:9 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease

What am I doing wrong?

Thanks



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!

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.

Heya,

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.