PHP is a server-side scripting language, also known as a “Hypertext Preprocessor.” It is used for developing static and dynamic web applications. PHP is used by many popular frameworks including Laravel, Symfony, and CodeIgniter. PHP 8.5 was officially released on November 26, 2020. At the time of writing this tutorial, the latest stable release is PHP 8.5.

In this post, we will show you how to install PHP 8.5 on Rocky Linux 10.

Step 1 – Install EPEL and Remi PHP Repository

In order to install PHP 8.4, you will need to install the EPEL and Remi PHP repositories on your system. You can install them with the following command:

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

Once both packages are installed, verify the available PHP versions with the following command:

dnf module list php

You should see the following output:

Remi's Modular repository for Enterprise Linux 10 - x86_64
Name                              Stream                                    Profiles                                                Summary                                             
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 [e]                              common [d], devel, minimal                              PHP scripting language                              
php                               remi-8.5                                  common [d], devel, minimal                              PHP scripting language                              

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

Step 2 – Install PHP 8.5 on Rocky Linux 10

First, reset the default PHP module with the following command:

dnf module reset php
Next, enable the Remi PHP 8.5 module with the following command:
dnf module enable php:remi-8.5

You should see the following output:

Last metadata expiration check: 0:01:43 ago on Sat 25 Oct 2025 12:16:41 AM EDT.
Dependencies resolved.
========================================================================================================================================================================================
 Package                                     Architecture                               Version                                       Repository                                   Size
========================================================================================================================================================================================
Enabling module streams:
 php                                                                                    remi-8.5                                                                                       

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

Is this ok [y/N]: y
Complete!

Next, install PHP with other common extensions using the following command:

dnf install php php-cli php-mysqlnd php-gd php-curl -y

Once PHP has been installed, you can verify the PHP version with the following command:

php -v

You should see the following output:

PHP 8.5.0RC3 (cli) (built: Oct 21 2025 20:30:57) (NTS gcc x86_64)
Copyright (c) The PHP Group
Built by Remi's RPM repository <https://rpms.remirepo.net/> #StandWithUkraine
Zend Engine v4.5.0RC3, Copyright (c) Zend Technologies
    with Zend OPcache v8.5.0RC3, Copyright (c), by Zend Technologies

Conclusion

Congratulations! You have successfully installed PHP 8.5 on Rocky Linux 10. PHP 8.5 comes with some major updates and new features including, error handling, match expression, null safe operator, JIT, and more. You can now upgrade your older PHP version to the latest PHP 8.5 and take its improved performance benefit. Give it a try on dedicated server hosting from Atlantic.Net!