VOOZH about

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

⇱ How To Install PHP 7.4 and Set Up a Local Development Environment on Ubuntu 20.04 | DigitalOcean


How To Install PHP 7.4 and Set Up a Local Development Environment on Ubuntu 20.04

Updated on March 12, 2026
Not using Ubuntu 20.04?
Choose a different version or distribution.
Ubuntu 20.04
πŸ‘ How To Install PHP 7.4 and Set Up a Local Development Environment on Ubuntu 20.04

The author selected Open Sourcing Mental Illness Ltd to receive a donation as part of the Write for DOnations program.

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the author

Committed to helping software developers to be successful by solving challenges in both their careers and their parenting.

Still looking for an answer?

Was this helpful?

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!

Great guide as ever. Thank you.

PS the composer hash seems to be out of date now.

I went through your β€œHow To Install Nginx on Ubuntu 20.04” and this β€œHow To Install PHP 7.4 and β€œSet Up a Local Development Environment on Ubuntu 20.04” on a clean Ubuntu 20.04 server install” through just before the section on composer.

After the Nginx install, ufw app list was as you show.

However, after the PHP7.4 install I now have Apache also installed. Is this intended / as expected? I did not knowingly run a command that I would have expected to install apache.

Thanks.

its not working i did same thing but php 7.3 or 7.4 not getting installed i have unbuntu 22.10

root@lacasse-dev:~# sudo apt -y install php7.4
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package php7.4 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'php7.4' has no installation candidate
πŸ‘ Creative Commons
This work is licensed under a Creative Commons Attribution-NonCommercial- ShareAlike 4.0 International License.
  • Deploy on DigitalOcean

    Click below to sign up for DigitalOcean's virtual machines, Databases, and AIML products.

Become a contributor for community

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

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and AI-native businesses

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

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

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Β© 2026 DigitalOcean, LLC.Sitemap.
Dark mode is coming soon.