Installing PHP 8.1 on Ubuntu 23.10

After the update to Ubuntu 23.10, my nginx (which used php7.4) is no longer working. I need to install php8.1 (or 7.4) in order to update my site.

How do I get PHP 8.1 to install on Ubuntu 23.10?

Asked By: jloper


Ubuntu 23.10 only have PHP 8.2 in the default repos.

Usually the easiest way to install older PHP versions on Ubuntu is to use ondrej’s repo, but it doesn’t support non-LTS releases anymore, so in you cases, this will not help.

My suggestion is to downgrade to last LTS release – Ubuntu 22.04 and install PHP 8.1 there.

If you really want to use Ubuntu 23.10, you can always build PHP 8.1 from sources but that can be more complex and time consuming.

Answered By: sotirov
Categories: Answers Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.