Installing PHP 8.4 on Ubuntu 22.04 via Ondřej's PPA

PHP 8.4 is a development/pre-release version of PHP introducing new features and performance improvements. This guide explains how to install PHP 8.4 on Ubuntu 22.04 (Jammy Jellyfish) using the official Launchpad PPA maintained by Ondřej Surý, which provides updated and stable PHP builds for Ubuntu systems.

PHP 8.4 is under active development (alpha/beta as of May 2025). Do not use it in production environments.

Prerequisites

Ensure your system is up to date and required packages are available.

Update System Packages

apt update && apt upgrade -y

Install Required Packages

apt install -y apt-transport-https lsb-release ca-certificates curl gnupg2 software-properties-common

Add Ondřej’s PHP PPA

Ondřej Surý maintains a widely trusted PHP repository for Ubuntu. Add the PPA:

add-apt-repository ppa:ondrej/php

Update Package Index

apt update

Install PHP 8.4 and Extensions

Install PHP 8.4 with commonly used extensions.

apt install -y php8.4 php8.4-cli php8.4-mysql php8.4-zip php8.4-xml php8.4-gd php8.4-curl php8.4-mbstring php8.4-bcmath php8.4-soap php8.4-readline php8.4-intl php8.4-common

You can add or remove extensions depending on your specific application needs.

Verify PHP Installation

Check the installed PHP version:

php -v

Expected output should begin with:

root@vps:~# php -v
PHP 8.4.7 (cli) (built: May  9 2025 06:54:08) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.4.7, Copyright (c) Zend Technologies
    with Zend OPcache v8.4.7, Copyright (c), by Zend Technologies

Conclusion

You’ve now successfully installed PHP 8.4 on Ubuntu 22.04 using Ondřej's PPA.


CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS