Remi’s RPM repository is a free and stable YUM repository mainly for the PHP stack. It contains packages for the latest versions of PHP. The Remi repository can be used on on Fedora and Enterprise Linux (RHEL / Alma / Rocky and other clones).
Prerequisites
To follow along this guide, ensure you have the following:
- A RHEL Based Server with root access or a user who can execute sudo commands
- Internet access
- Some packages in the Remi Repository depends on
epel-release
so if you don’t have install it with
sudo dnf install epel-release
For older versions of RHEL/Centos, checkout:
Enabling the remi repo
To enable the remi repo, Install the rpm
provided by remi in this url http://rpms.remirepo.net/enterprise/remi-release-<version>.rpm
, version being the RHEL Release version.
Example:
For RHEL / Alma / Rocky Linux 8:
sudo rpm -ivh http://rpms.remirepo.net/enterprise/remi-release-8.rpm
# Or
sudo dnf install http://rpms.remirepo.net/enterprise/remi-release-8.rpm
For RHEL / Alma / Rocky Linux 9:
sudo rpm -ivh http://rpms.remirepo.net/enterprise/remi-release-9.rpm
# Or
sudo dnf install http://rpms.remirepo.net/enterprise/remi-release-9.rpm
Once the installation is done, confirm that the repo is enabled with this command:
repo id repo name
...
remi-modular Remi's Modular repository for Enterprise Linux 9 - x86_64
remi-safe Safe Remi's RPM repository for Enterprise Linux 9 - x86_64
If you see remi in the list then it means its been installed.
Installing packages from Remi repository
To use packages from the remi repository, you need to enable them. Lets list modules providing php using this command:
$ sudo dnf module list php
Last metadata expiration check: 0:00:07 ago on Fri 21 Oct 2022 07:05:57 AM UTC.
Remi's Modular repository for Enterprise Linux 9 - 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
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
If you want to install php 8.2 for instance, enable it with this command:
sudo dnf module enable php:remi-8.2
You can then install it with the dnf install command:
sudo dnf install php php-cli
To search all packages, use this command:
sudo dnf search php
That is it!
We managed to enable and set up REMI release on RHEL 8 and 9 and its derivatives.