REMI is a free-to-use repository created and maintained by Remi Collect. The REMI repository’s primary goal is to provide the latest versions of the PHP stack, full-featured, and some other software packages to the Fedora and Enterprise Linux (RHEL, CentOS, Oracle, AlmaLinux, Rocky Linux) operating systems. The repository contains several thousand individual RPM packages that are continuously updated to match the latest upstream releases. In addition to providing access to the latest software packages, REMI also makes it easy to install multiple versions of the same software on a single system. This can be useful for testing or running software incompatible with the latest version. REMI is an essential resource for anyone using Fedora or Enterprise Linux, and it is well worth setting up.
In the following tutorial, you will learn how to import the Remi Repository on Fedora Linux for users who prefer to install the latest version of the PHP branch installed on their system using the command line terminal.
Table of Contents
Recommended Steps Before Installation
First, update your system to ensure all existing packages are up to date. This will ensure no conflicts arise as best as possible during the installation.
sudo dnf upgrade --refresh -y
Import Remi Repository on Fedora Linux
The first task is to import the Remi repository. This is straightforward on Fedora, unlike RHEL and its clones, where you need to install EPEL, for example. Ensure you import the correct repository that matches your version of Fedora.
Import Remi Repo for Fedora 37
sudo dnf install http://rpms.remirepo.net/fedora/remi-release-37.rpm -y
Import Remi Repo for Fedora 36
sudo dnf install http://rpms.remirepo.net/fedora/remi-release-36.rpm -y
Import Remi Repo for Fedora 35
sudo dnf install http://rpms.remirepo.net/fedora/remi-release-35.rpm -y
Enable PHP Remi RPM on Fedora Linux
A quick tip is to use the dnf module list command to see the options available and the default.
The following dnf module list command can do this:
dnf module list php
You will be prompted to import the GPG key for Remi’s repository. Type (Y) to proceed if you encounter it.
Example output:
Next, enable the PHP version you would prefer to work with.
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
Example output:
============================================================================
Package Architecture Version Repository Size
============================================================================
Enabling module streams:
php remi-8.2
Transaction Summary
============================================================================
Complete!
Once done, install PHP as you usually would.
sudo dnf install php php-cli
Verify the PHP installation and build.
php --version
Example output:
[joshua@fedora-linux ~]$ php -v
PHP 8.2.0RC6 (cli) (built: Nov 8 2022 06:25:57) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.2.0RC6, Copyright (c) Zend Technologies
Enable Remi Redis RPM on Fedora Linux
Remi RPM does have additional packages; most EPEL users would be familiar with Memcached and Redis being available. For Fedora users, especially F37 users, only 7.0 and 6.2 are available to install. I recommend installing 7.0; given you are using Fedora, you should be using the latest version, but I have included both.
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