How to Install Remi RPM on Rocky Linux EL9 or EL8

REMI is a comprehensive third-party repository that offers the most recent and cutting-edge versions of PHP and its modules for RHEL-based systems. As a must-have for any active PHP developer, this repository boasts an easy setup process, thanks to its well-documented instructions that even a beginner can follow to get it up and running in just a few minutes.

One of the key advantages of using REMI over other third-party repositories or compiling PHP from source code is its consistent RPM packaging with official repositories. This ensures a smooth experience when installing software that depends on PHP from the official repositories, avoiding compatibility issues. REMI is a one-stop repository for those using an RHEL-based distribution and looking to stay up-to-date with the latest version of PHP.

The repository provides the latest PHP versions and includes cutting-edge releases of other popular open-source packages, such as the latest versions of Memcached and Redis, making it a feature-rich solution for your server. This guide will demonstrate the steps to import the REMI repository on Rocky Linux 9, allowing users to install the latest PHP branch via the terminal.

Step 1: Update Rocky Linux

Before proceeding with any new installations on Rocky Linux, it is important first to upgrade your system to ensure all existing packages are up to date. This important step will help minimize potential conflicts that may arise during the installation process.

sudo dnf upgrade --refresh

Step 2: Import Remi Repository

Before importing the Remi PHP repository, installing the EPEL (Extra Packages for Enterprise Linux) repository is important. This repository is a helpful resource for new users of distributions like Rocky Linux, built on RHEL. It offers a comprehensive collection of software packages frequently used in Enterprise Linux environments.

Ensure to import the appropriate Remi RPM that corresponds to your specific distribution version, as this guide encompasses Rocky Linux 8 and Rocky Linux 9.

Import Remi PHP Repository for Rocky Linux 9

Before proceeding, activate the CRB (Code Ready Builder).

sudo dnf config-manager --set-enabled crb

With the Code Ready Builder (CRB) activated, execute the following command to install both Extra Packages for Enterprise Linux (EPEL) versions.

sudo dnf install \
    https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \
    https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-9.noarch.rpm

To add the Remi repository for Enterprise Linux 9 to your system, execute the following command.

sudo dnf install dnf-utils http://rpms.remirepo.net/enterprise/remi-release-9.rpm -y

Import Remi PHP Repository for Rocky Linux 8

Initiate the activation of the EPEL repository on Rocky Linux 8 using the following command.

sudo dnf install \
    https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \
    https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-8.noarch.rpm

Now, run the following command to import the Remi Enterprise Linux 8 repository.

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

Step 3: Enable Remi PHP Repository

By importing the Remi RPM repository, you can access the latest versions of the PHP branch you are currently using or deploying in your server stack. To get an overview of the supported versions of PHP, you can run the following command to list all available PHP modules.

sudo dnf module list php

Example output:

After listing the available PHP modules, you can choose the PHP version that best fits your needs and enable it on your system.

Example:

Enable PHP 7.4

sudo dnf module enable php:remi-7.4 -y

Enable PHP 8.0

sudo dnf module enable php:remi-8.0 -y

Enable PHP 8.1

sudo dnf module enable php:remi-8.1 -y

Enable PHP 8.2

sudo dnf module enable php:remi-8.2 -y

Once you have selected the desired version of PHP, proceed with the installation process as you usually would.

sudo dnf install php

Step 4: Enable Additional Remi RPM Repositories

In addition to its primary focus on PHP, the Remi RPM repository also offers support for the latest versions of Redis and Memcached. The installation process for these popular caching tools can be easily performed through the Remi RPM repository.

Enable Memcached RPM

sudo dnf module enable memcached:remi

Then run the Memcached installation command.

sudo dnf install memcached

Enable Remi Redis RPM

sudo dnf module enable redis:remi-{version}

Replace {version} with your desired version.

Enable Redis 7.0:

sudo dnf module enable redis:remi-7.0 -y

Enable Redis 6.2:

sudo dnf module enable redis:remi-6.2 -y

Enable Redis 5.0:

sudo dnf module enable redis:remi-5.0 -y

Once you have enabled the specific Redis branch, run the standard installation command that will either install or upgrade your existing installation.

sudo dnf install redis

Conclusion

REMI provides a comprehensive solution for Rocky Linux users to stay updated with the latest stable releases of PHP, Redis, Memcached, and more. The repository is well-documented and easy to set up, making it a convenient option for developers looking to keep their systems up to date. The consistent RPM packaging provided by REMI ensures that there will be no issues when installing other software that depends on PHP, making it a valuable addition to any RHEL-derived distribution. In conclusion, if you are a Rocky Linux user looking for a reliable and efficient way to stay updated with the latest versions of PHP and its modules, we highly recommend incorporating the Remi RPM repository into your workflow.

Frequently Asked Questions

Is the Remi RPM repository safe to use on Rocky Linux?

Yes, the Remi RPM repository is safe to use on Rocky Linux. The repository is maintained by a reputable developer and has been used by thousands of Linux users.

Do I need to install the Remi RPM repository on Rocky Linux?

No, you don’t need to install the Remi RPM repository on Rocky Linux. However, if you’re looking to add additional packages to your system or access the latest versions of software packages, you may find it helpful.

Why is Remi RPM important for Rocky Linux users?

By using Remi RPM, Rocky Linux users can access the latest and most up-to-date versions of PHP and other popular software packages, helping them to stay ahead of the curve in their development work. Additionally, Remi RPM helps ensure compatibility with official repositories, avoiding any issues that may arise from installing other software that depends on PHP from the official repositories.

Does Remi RPM support multiple versions of PHP?

Yes, Remi RPM supports multiple versions of PHP, including the latest and LTS versions, allowing users to choose the version that best suits their needs.

Does Remi RPM support other software packages besides PHP?

Yes, Remi RPM supports popular software packages such as Redis, Memcached, and other PHP modules.

Can Remi RPM be used on other distributions besides Rocky Linux?

Remi RPM is designed to work with RHEL-based distributions, including Rocky Linux, and is not recommended for other distributions.

Share to...