Installing PHP 8.4 on AlmaLinux 8 via Remi Repository

PHP 8.4 is the upcoming version of PHP, currently available in development (alpha/beta) stages. This guide helps you install it on AlmaLinux 8 using Remi’s repository for testing and evaluation purposes.

Note: As of May 2025, PHP 8.4 is not officially stable. Do not use in production environments.

Prerequisites

Ensure your system is up to date and has dnf-utils installed:

sudo dnf update -y
sudo dnf install dnf-utils -y

Install the EPEL and Remi repositories:

sudo dnf install epel-release -y
sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm -y

Output:

[root@vps ~]# sudo dnf install epel-release -y
Last metadata expiration check: 0:12:01 ago on Sat 24 May 2025 01:12:04 PM UTC.
Dependencies resolved.
================================================================================
 Package               Architecture    Version            Repository       Size
================================================================================
Installing:
 epel-release          noarch          8-21.el8           extras           24 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 24 k
Installed size: 34 k
Downloading Packages:
epel-release-8-21.el8.noarch.rpm                1.3 MB/s |  24 kB     00:00
--------------------------------------------------------------------------------
Total                                            71 kB/s |  24 kB     00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1
  Installing       : epel-release-8-21.el8.noarch                           1/1
  Running scriptlet: epel-release-8-21.el8.noarch                           1/1
Many EPEL packages require the CodeReady Builder (CRB) repository.
It is recommended that you run /usr/bin/crb enable to enable the CRB repository.

  Verifying        : epel-release-8-21.el8.noarch                           1/1

Installed:
  epel-release-8-21.el8.noarch

Complete!
[root@vps ~]# sudo dnf install https://rpms.remirepo.net/enterprise/remi-release                                                                                                             -8.rpm -y
Extra Packages for Enterprise Linux 8 - x86_64   16 MB/s |  14 MB     00:00
Last metadata expiration check: 0:00:16 ago on Sat 24 May 2025 01:24:22 PM UTC.
remi-release-8.rpm                                                                                                                                           362 kB/s |  37 kB     00:00
Dependencies resolved.
=============================================================================================================================================================================================
 Package                                       Architecture                            Version                                           Repository                                     Size
=============================================================================================================================================================================================
Installing:
 remi-release                                  noarch                                  8.10-2.el8.remi                                   @commandline                                   37 k

Transaction Summary
=============================================================================================================================================================================================
Install  1 Package

Total size: 37 k
Installed size: 34 k
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                     1/1
  Installing       : remi-release-8.10-2.el8.remi.noarch                                                                                                                                 1/1
  Verifying        : remi-release-8.10-2.el8.remi.noarch                                                                                                                                 1/1

Installed:
  remi-release-8.10-2.el8.remi.noarch

Complete!

Check Available PHP Modules

Check if PHP 8.4 is available (it may be in a test or dev stream)

dnf module list php

Look for a line like:

php                                  remi-8.4                                 common [d], devel, minimal                                PHP scripting language

Enable PHP 8.4 Module

Reset the default PHP module and enable PHP 8.4

sudo dnf module reset php -y
sudo dnf module enable php:remi-8.4 -y

Output:

[root@vps ~]# sudo dnf module reset php -y
Last metadata expiration check: 0:01:55 ago on Sat 24 May 2025 01:26:01 PM UTC.
Dependencies resolved.
Nothing to do.
Complete!
[root@vps ~]# sudo dnf module enable php:remi-8.4 -y
Last metadata expiration check: 0:02:02 ago on Sat 24 May 2025 01:26:01 PM UTC.
Dependencies resolved.
=============================================================================================================================================================================================
 Package                                      Architecture                                Version                                         Repository                                    Size
=============================================================================================================================================================================================
Enabling module streams:
 php                                                                                      remi-8.4

Transaction Summary
=============================================================================================================================================================================================

Complete!

Install PHP 8.4 and Extensions

Install PHP 8.4 and common extensions

sudo dnf install php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json -y

Verify Installation

Check the PHP version

php -v

Output:

[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

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