Installing PHP 8.4 on Rocky Linux 8 via Remi Repository
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 Rocky Linux 8 using the Remi repository, which provides updated PHP versions for RHEL-based systems.
PHP 8.4 is under active development (alpha/beta as of May 2025). It is not recommended for production use.
Prerequisites
Ensure your system is up to date and required tools are installed.
Update System
dnf update -y
Install Required Utilities
dnf install -y dnf-utils epel-release
Enable Remi Repository
Install and configure the Remi repository to access newer PHP versions.
Install Remi Repository RPM
dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
Enable PHP 8.4 Module
Reset the default PHP module and enable PHP 8.4 from Remi:
dnf module reset php -y
dnf module enable php:remi-8.4 -y
Install PHP 8.4 and Common Extensions
Install PHP 8.4 along with commonly used extensions.
dnf install -y php php-cli php-common php-mysqlnd php-pdo php-gd php-mbstring php-xml php-bcmath php-curl php-intl php-soap php-zip php-readline
Add or remove extensions as per your project 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 6 2025 12:31:58) (NTS gcc x86_64)
Copyright (c) The PHP Group
Built by Remi's RPM repository <https://rpms.remirepo.net/> #StandWithUkraine
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 Rocky Linux 8 using the Remi repository.
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