Skip to content

$ cat how-to-install-old-or-new-php-on-non-lts-ubuntu.md

How to install old or new PHP on non-LTS Ubuntu

Learn how to install and run a specific PHP version, either older or newer than the default, on a non-LTS Ubuntu release. The article covers running legacy PHP such as 7.2 on Ubuntu 25 for maintaining older projects.

Rector25 Apr 2025 · 1 min read · summary
Read on getrector.com ↗
Legacy projects can be upgraded in 2 directions - PHP-wise and infrastructure-wise. We can get a new Ubuntu 25 but still have to run old PHP. The same goes for upgrading a legacy project. Locally, we use Ubuntu 25, but we work on a project that uses PHP 7.2. By default, Ubuntu releases ship only one PHP version. Often we need one of the other ~10 versions. How do we run old or new PHP on the latest Ubuntu?

source

This is a summary of an article first published by Rector. The full piece is on their site.

Open original