Home Issue PHP Installation Issue on Ubuntu 20.04

PHP Installation Issue on Ubuntu 20.04

Last updated on Aug 05, 2025

Why You Can't Install PHP 8.x Using ondrej/php Anymore

Last Updated: August 5, 2025

โ“ Whatโ€™s the Issue?

If you're using Ubuntu 20.04 and trying to install PHP (especially versions like PHP 8.1 or 8.3) using the popular repository ppa:ondrej/php, you may encounter errors like:

E: Unable to locate package php8.3

This happens even if youโ€™ve successfully added the PPA.

๐Ÿ“Œ Root Cause

As of May 29, 2025, Ubuntu 20.04 has reached End of Standard Support.
The ondrej/php PPA no longer supports Ubuntu 20.04 for new package installations.

The maintainer of the PPA has officially removed support for Ubuntu 20.04 after it exited the standard support window.

You can read more in the official GitHub issue:
๐Ÿ”— https://github.com/oerdnj/deb.sury.org/issues/2243

๐Ÿ” What This Means for You

โœ… Recommended Solutions

1. Upgrade to Ubuntu 22.04 or 24.04

  • These versions are still within their standard support periods.

  • ppa:ondrej/php continues to support them fully.

2. Avoid Fresh Setups on Ubuntu 20.04

  • Avoid rebuilding or provisioning new environments using Ubuntu 20.04 + ondrej/php.

๐Ÿ› ๏ธ Quick Fix for Existing Projects

If you're working on an existing Ubuntu 20.04 machine and PHP was already installed:

  • You can keep using it, but no new PHP versions or updates from ondrej/php will be available.

  • Back up the system to avoid accidental reprovisioning.

๐Ÿ™‹ Frequently Asked Questions

Q: Why does PHP 7.4 still install on Ubuntu 20.04?
A: PHP 7.4 is available from the default Ubuntu repositories, not from the PPA.

Q: Can I force the PPA to work on Ubuntu 20.04?
A: Technically possible with hacks, but not recommended. Itโ€™s better to upgrade your OS to stay secure and compatible.