Report this

What is the reason for this report?

How to upgrade php version from 7.4.3 to 8.X?

Posted on November 24, 2025

I followed the steps here https://www.digitalocean.com/community/questions/upgrade-to-latest-php-from-php7-4-nginx-ubuntu-20 as I am on Ubuntu 20 as well but I keep getting the error sudo apt install php8.3-fpm -y Reading package lists… Done Building dependency tree
Reading state information… Done E: Unable to locate package php8.3-fpm E: Couldn’t find any package by glob ‘php8.3-fpm’



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, @b1cfd497da4348d08019b0315db7a0

You get that error because php8.3-fpm is not in the default Ubuntu repos. You only have PHP 7.4 there unless you add a 3rd-party repo (usually Ondřej Surý’s PPA), and even then support for 8.3 on 20.04 may lag.

You’ll need to add Ondřej Surý’s PPA, which is the common way to get PHP 8.x on Ubuntu.

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php8.3

After that you should be able to install and switch between PHP versions.

Hope that this helps!

Hi there,

On Ubuntu 20.04 you won’t see php8.3 in the default repos, so the package errors make sense. PHP 8.x on that release usually comes from Ondrej Sury’s PPA. Without it, apt just won’t know what php8.3-fpm is.

I think the first step is adding the PPA and updating your package list:

sudo add-apt-repository ppa:ondrej/php
sudo apt update

After that you can check what versions are actually available:

apt-cache search php8

I haven’t tested 8.3 specifically on 20.04, but if it’s published in the PPA it should show up there. If it doesn’t, the highest available version may be 8.2 for that Ubuntu release, so maybe worth spinning up a new Droplet with the latest Ubuntu version.

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.