Install PHP 8.4 on Rocky Linux 8 | AlmaLinux 8

PHP 8.4 is a major update and release of the PHP programming language of the 8.x series. PHP is a widely used programming language in development of websites and Web applications. Some of the most used website content management systems such as WordPress, Drupal and Joomla are written in PHP. This release of PHP comes with numerous improvements and new features such as:

  • Union Types
  • Named Arguments
  • Match Expressions
  • Attributes
  • Constructor Property Promotion
  • Nullsafe Operator
  • Weak Maps
  • Just In Time Compilation
  • And much much more…

In this short article we will be performing installation of PHP 8.4 on Rocky Linux 8 | AlmaLinux 8. PHP 8.4 packages are not available in OS AppStream repositories. We’ll need to add Remi RPM repositories to our AlmaLinux / Rocky OS which contains the packages that we need to install.

Add Remi YUM repository

Install and enable EPEL repository

sudo yum -y install epel-release

Also enable powertools repository:

sudo yum -y install yum-utils
sudo yum-config-manager --enable powertools

Add Remi repository to Rocky Linux 8 | AlmaLinux 8:

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

Install PHP 8.4 on Rocky Linux 8 | AlmaLinux 8

Reset PHP default module:

sudo dnf -y module reset php

Check for avaiable PHP modules from the Remi repository:

$ dnf module list php
Last metadata expiration check: 0:01:25 ago on Fri 21 Mar 2025 04:11:56 PM EAT.
Rocky Linux 8 - AppStream
Name                      Stream                        Profiles                                        Summary                                   
php                       7.2 [d]                       common [d], devel, minimal                      PHP scripting language                    
php                       7.3                           common [d], devel, minimal                      PHP scripting language                    
php                       7.4                           common [d], devel, minimal                      PHP scripting language                    
php                       8.0                           common [d], devel, minimal                      PHP scripting language                    
php                       8.2                           common [d], devel, minimal                      PHP scripting language                    

Remi's Modular repository for Enterprise Linux 8 - x86_64
Name                      Stream                        Profiles                                        Summary                                   
php                       remi-7.2                      common [d], devel, minimal                      PHP scripting language                    
php                       remi-7.3                      common [d], devel, minimal                      PHP scripting language                    
php                       remi-7.4                      common [d], devel, minimal                      PHP scripting language                    
php                       remi-8.0                      common [d], devel, minimal                      PHP scripting language                    
php                       remi-8.1                      common [d], devel, minimal                      PHP scripting language                    
php                       remi-8.2                      common [d], devel, minimal                      PHP scripting language                    
php                       remi-8.3                      common [d], devel, minimal                      PHP scripting language                    
php                       remi-8.4                      common [d], devel, minimal                      PHP scripting language                    

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

Enable Remi repository for PHP 8.4:

sudo dnf module install php:remi-8.4

Confirm package dependencies and proceed with the installation:

Last metadata expiration check: 0:03:38 ago on Fri 21 Mar 2025 04:10:42 PM EAT.
Dependencies resolved.
==================================================================================================================================================
 Package                         Architecture          Version                                                  Repository                   Size
==================================================================================================================================================
Installing group/module packages:
 php-cli                         x86_64                8.4.5-1.el8.remi                                         remi-modular                3.9 M
 php-common                      x86_64                8.4.5-1.el8.remi                                         remi-modular                791 k
 php-fpm                         x86_64                8.4.5-1.el8.remi                                         remi-modular                2.0 M
 php-mbstring                    x86_64                8.4.5-1.el8.remi                                         remi-modular                544 k
 php-xml                         x86_64                8.4.5-1.el8.remi                                         remi-modular                885 k
Installing dependencies:
 httpd-filesystem                noarch                2.4.37-65.module+el8.10.0+1938+3b7755d4.3                appstream                    44 k
 libxslt                         x86_64                1.1.32-6.el8                                             baseos                      249 k
 oniguruma5php                   x86_64                6.9.10-1.el8.remi                                        remi-safe                   215 k
Installing weak dependencies:
 nginx-filesystem                noarch                1:1.14.1-9.module+el8.4.0+542+81547229                   appstream                    23 k
Installing module profiles:
 php/common                                                                                                                                      
Enabling module streams:
 httpd                                                 2.4                                                                                       
 nginx                                                 1.14                                                                                      
 php                                                   remi-8.4                                                                                  

Transaction Summary
==================================================================================================================================================
Install  9 Packages

Total download size: 8.6 M
Installed size: 34 M
Is this ok [y/N]: y

Import required repository key when asked:

Remi's Modular repository for Enterprise Linux 8 - x86_64                                                         3.0 MB/s | 3.1 kB     00:00    
Importing GPG key 0x5F11735A:
 Userid     : "Remi's RPM repository <[email protected]>"
 Fingerprint: 6B38 FEA7 231F 87F5 2B9C A9D8 5550 9759 5F11 735A
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-remi.el8
Is this ok [y/N]: y

To install additional packages use the command below:

sudo yum install php-[package_name]

Below example install PHP and commonly used PHP extensions:

sudo yum install -y 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

Use the next commands to check the installed version:

$ php --version
PHP 8.4.5 (cli) (built: Mar 12 2025 01:55:56) (NTS gcc x86_64)
Copyright (c) The PHP Group
Built by Remi's RPM repository <https://rpms.remirepo.net/> #StandWithUkraine
Zend Engine v4.4.5, Copyright (c) Zend Technologies
    with Zend OPcache v8.4.5, Copyright (c), by Zend Technologies

Checking all available PHP extensions:

$ php --modules
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
libxml
mbstring
mcrypt
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
random
readline
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

Enjoy your applications development and hosting on Rocky Linux 8 | AlmaLinux 8 using PHP 8.4.

More guides on AlmaLinux / Rocky:

Your IT Journey Starts Here!

Ready to level up your IT skills? Our new eLearning platform is coming soon to help you master the latest technologies.

Be the first to know when we launch! Join our waitlist now.

Join our Linux and open source community. Subscribe to our newsletter for tips, tricks, and collaboration opportunities!

Recent Post

Leave a Comment

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.

Related Post

This tutorial will show you how to install and use MongoDB Compass on Ubuntu 24.04 | Debian 12 in a […]

We looked at how to install Jira on Rocky Linux Server in our previous tutorial. In this article, We’ll learn […]

Atlassian created Jira, a bug tracking and agile project management application. Jira has a number of solutions and deployment choices […]

Let's Connect

Unleash the full potential of your business with CloudSpinx. Our expert solutions specialists are standing by to answer your questions and tailor a plan that perfectly aligns with your unique needs.
You will get a response from our solutions specialist within 12 hours
We understand emergencies can be stressful. For immediate assistance, chat with us now

Contact CloudSpinx today!

Download CloudSpinx Profile

Discover the full spectrum of our expertise and services by downloading our detailed Company Profile. Simply enter your first name, last name, and email address.