I need to update my php version for an app. Here is the version I am running: PHP 8.1.2-1ubuntu2.21 (cli) (built: Mar 24 2025 19:04:23) (NTS). I am running Ubuntu 22.04.5.
My system says it is up-to-date. How do I get a minimum of 8.2, or preferably, the latest stable version?
If you were to consider using the latest Ubuntu LTS 24.04, the php version is 8.3.
Have a look at this Ubuntu Resource to find package versions
Is there a way to Install a newer version of the package? This is what I see when I search. Not sure why it’s not showing me 8.1.2 version.
===================================
Searching for packages named exactly “php” shows both the 8.1 version for jammy and the 8.3 version that tea-for-one noted is available in noble.
Are you able to upgrade to Ubuntu 24.04? If so, this is the first option to consider.
If you cannot upgrade Ubuntu, does this repository of various php versions has what you need?
Just keep in mind that security support for packages from this repo is best effort only (you might not get any that is) … and that if you seek general support for it, do not do it here …
I found this. May help
https://php.watch/articles/install-php82-ubuntu-debian
I’ve not tested this myself
Do keep in mind that bolting wrong-version or non-Ubuntu packages onto an older LTS is a common and easy way to break that system.
You can do it. Many people do. Many people do it happily and without problems.
But there is risk. Some people encounter problems. Some people wind up reinstalling amid a rain of tears.
It’s a matter of how you judge the risk.
And a matter of your skills to diagnose and repair package incompatibilities.