How to Install Remi RPM Repo on Fedora

The Remi repository provides up-to-date PHP versions and related software packages for Fedora and Enterprise Linux distributions. Whether you need the latest PHP release for a web application, want to run multiple PHP versions side-by-side for testing, or require newer builds of Redis for caching, Remi fills gaps that Fedora’s default repositories may not cover. By the end of this guide, you will have the Remi repository configured on your Fedora system, with PHP modules enabled and installed, plus optional access to Redis for high-performance caching.

What Remi Provides

The Remi repository extends Fedora’s package selection with newer versions and additional modules. The following table compares what each source offers:

PackageFedora DefaultRemi Repository
PHPSingle version (e.g., 8.3)Multiple versions (7.4 through 8.5) with module switching
RedisValkey fork (Redis-compatible)Original Redis with modular version selection
PHP ExtensionsCore extensions onlyExtended PECL extensions (imagick, redis, memcached)

If you only need Fedora’s default PHP version and do not require Redis from the original project, you can skip the Remi repository entirely. For those needing multiple PHP versions or the original Redis, Remi provides these options through DNF’s modular system.

Update Fedora System Before Adding Remi

Before adding any third-party repository, update your existing packages to ensure compatibility and reduce the risk of dependency conflicts. Run the following command to refresh package metadata and apply available updates:

sudo dnf upgrade --refresh

This command refreshes the repository metadata cache and upgrades all installed packages to their latest versions. Once complete, your system is ready for the Remi repository installation.

Install Remi Repository on Fedora

Unlike Red Hat Enterprise Linux and its derivatives (Rocky Linux, AlmaLinux, CentOS Stream), Fedora does not require EPEL as a prerequisite for Remi. The installation uses a single command that automatically detects your Fedora version:

sudo dnf install https://rpms.remirepo.net/fedora/remi-release-$(rpm -E %fedora).rpm -y

Expected output showing the package installation:

Package       Arch   Version        Repository        Size
Installing:
 remi-release noarch 43-2.fc43.remi @commandline  33.7 KiB

Transaction Summary:
 Installing:         1 package

Complete!

The $(rpm -E %fedora) expression expands to your current Fedora release number (such as 42, 43, or 44), making this command work across all supported Fedora versions without modification.

After installation completes, verify that the Remi repositories are available on your system:

dnf repolist | grep remi

You should see output confirming the repositories are configured:

remi                  Remi's RPM repository - Fedora 43 - x86_64
remi-modular          Remi's Modular repository - Fedora 43 - x86_64

The remi repository provides standalone packages, while remi-modular enables PHP and Redis version switching through DNF modules. Both repositories are now available for package installation.

Enable and Install PHP from Remi

List Available PHP Versions

With the Remi repository installed, you gain access to multiple PHP versions through DNF’s module system. This approach allows developers to switch between PHP versions for different projects or to test compatibility before upgrading production environments. First, list the available PHP modules:

dnf module list php

Expected output showing available PHP streams:

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 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

Each stream corresponds to a major PHP version. The common profile includes the core PHP package with commonly used extensions, while minimal provides only the base interpreter and devel adds development headers for compiling extensions.

Enable Your Preferred PHP Version

Choose the PHP version that matches your application requirements. For most new projects, PHP 8.4 provides the best balance of modern features and ecosystem compatibility. PHP 8.5 offers the latest features for those wanting cutting-edge functionality. Enable your chosen version with one of the following commands:

PHP 8.5 (latest release):

sudo dnf module enable php:remi-8.5 -y

PHP 8.4 (recommended for production):

sudo dnf module enable php:remi-8.4 -y

PHP 8.3 (LTS, widely supported):

sudo dnf module enable php:remi-8.3 -y

PHP 8.2:

sudo dnf module enable php:remi-8.2 -y

PHP 8.1:

sudo dnf module enable php:remi-8.1 -y

PHP 8.0 (end of life since November 2023):

sudo dnf module enable php:remi-8.0 -y

PHP 7.4 (legacy applications only):

sudo dnf module enable php:remi-7.4 -y

PHP 7.4 reached end of life in November 2022 and no longer receives security updates. Use it only when maintaining legacy applications that cannot be upgraded, and plan migration to PHP 8.x as soon as possible.

Install PHP and Verify

After enabling the module stream, install PHP along with the command-line interface package:

sudo dnf install php php-cli -y

Once installation completes, verify the installed PHP version:

php --version

You should see output similar to the following, confirming the Remi-provided PHP version:

PHP 8.4.x (cli) (built: YYYY-MM-DD 16:03:34) (NTS gcc x86_64)
Copyright (c) The PHP Group
Built by Remi's RPM repository  #StandWithUkraine
Zend Engine v4.4.x, Copyright (c) Zend Technologies
    with Zend OPcache v8.4.x, Copyright (c), by Zend Technologies

The output confirms installation from the Remi repository, indicated by the “Built by Remi’s RPM repository” line. For web server integration, see our guides on configuring Nginx for PHP-FPM on Fedora and installing PHP on Fedora for additional configuration options.

Switch Between PHP Versions

If you need to change PHP versions later, reset the current module and enable a different stream. This process is useful when testing application compatibility or when upgrading to a newer PHP release:

sudo dnf module reset php -y
sudo dnf module enable php:remi-8.4 -y
sudo dnf install php php-cli -y

The reset command clears the current module selection, allowing you to enable a different version. As a result, DNF handles the package replacement automatically during the install step.

Enable and Install Redis from Remi

Redis is a high-performance in-memory data store commonly used for caching, session storage, and message queuing. The Remi repository provides newer Redis versions than Fedora’s default repositories, which benefits applications requiring recent features. For additional configuration options, see our dedicated guide on installing Redis on Fedora.

List Available Redis Versions

First, check which Redis module streams are available from Remi:

dnf module list redis:remi*

Expected output showing available Redis streams:

Name  Stream   Profiles   Summary                            
redis remi-8.0 common [d] Redis persistent key-value database
redis remi-8.2 common [d] Redis persistent key-value database
redis remi-8.4 common [d] Redis persistent key-value database

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

Enable and Install Redis

Enable your preferred Redis version. Redis 8.4 is the latest stream with the newest features:

sudo dnf module enable redis:remi-8.4 -y

Alternatively, for Redis 8.2 or 8.0:

sudo dnf module enable redis:remi-8.2 -y

Next, install the Redis package:

sudo dnf install redis -y

Then verify the installed version:

redis-server --version

Expected output:

Redis server v=8.4.0 sha=00000000:0 malloc=jemalloc-5.3.0 bits=64 build=f7fadcec9189b92

Then start and enable the Redis service to run automatically at boot:

sudo systemctl enable --now redis

Verify that Redis is running:

systemctl status redis --no-pager

Expected output showing the active service:

● redis.service - Redis persistent key-value database
     Loaded: loaded (/usr/lib/systemd/system/redis.service; enabled; preset: disabled)
     Active: active (running) since [timestamp]; 5s ago
   Main PID: 12345 (redis-server)
      Tasks: 5 (limit: 4644)
     Memory: 7.2M
        CPU: 45ms
     CGroup: /system.slice/redis.service
             └─12345 "/usr/bin/redis-server 127.0.0.1:6379"

Redis binds to localhost (127.0.0.1) by default, which prevents external access. If you need remote connections, configure authentication and firewall rules before changing the bind address in /etc/redis/redis.conf.

Install Memcached for PHP Caching

Memcached is a distributed memory caching system that reduces database load by storing frequently accessed data in memory. While not provided by the Remi repository, Memcached pairs well with PHP applications and complements the Remi PHP installation. Fedora’s default repositories include Memcached, so no module enable step is required:

sudo dnf install memcached -y

Once installed, start and enable the Memcached service:

sudo systemctl enable --now memcached

After starting the service, verify it is running:

systemctl status memcached --no-pager

Expected output:

● memcached.service - memcached daemon
     Loaded: loaded (/usr/lib/systemd/system/memcached.service; enabled; preset: disabled)
     Active: active (running) since [timestamp]; 3s ago
   Main PID: 12346 (memcached)
      Tasks: 10 (limit: 4644)
     Memory: 1.5M
        CPU: 12ms
     CGroup: /system.slice/memcached.service
             └─12346 /usr/bin/memcached -p 11211 -u memcached -m 64 -c 1024

Additionally, to use Memcached with PHP applications, install the PHP Memcached extension:

sudo dnf install php-pecl-memcached -y

If you installed PHP-FPM for use with a web server such as Nginx or Apache, restart the service to load the new extension:

sudo systemctl restart php-fpm

Troubleshoot Remi Repository Issues

Module Conflicts When Switching PHP Versions

If you encounter errors when trying to enable a different PHP module stream, you may see output like:

The operation would result in switching of module 'php' stream 'remi-8.4' to stream 'remi-8.3'
Error: It is not possible to switch enabled streams of a module unless explicitly enabled via configuration option module_stream_switch.

This error occurs because a PHP stream is already enabled. To resolve it, reset the module first:

sudo dnf module reset php -y
sudo dnf module enable php:remi-8.4 -y

GPG Key Import Prompts

When installing packages from Remi for the first time, DNF may prompt you to import the repository’s GPG key:

Importing GPG key 0x8F1F4B2D:
 Userid     : "Remi's RPM repository (https://rpms.remirepo.net/) <remi@remirepo.net>"
 Fingerprint: [key fingerprint will vary by year]
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-remi[year]
Is this ok [y/N]:

This is expected behavior. Type y and press Enter to accept the key. The key verifies that packages are genuinely from the Remi repository and have not been tampered with.

Repository Not Found After Fedora Upgrade

If you upgrade to a new Fedora release using dnf system-upgrade, the Remi repository configuration updates automatically to match your new Fedora version. However, if the repository appears missing, reinstall the release package:

sudo dnf install https://rpms.remirepo.net/fedora/remi-release-$(rpm -E %fedora).rpm -y

As a result, this reinstalls the repository configuration for your current Fedora version.

Slow Downloads from Remi

The Remi repository uses mirrors to distribute packages. If downloads are slow, DNF’s fastestmirror plugin typically selects the best mirror automatically. For persistent slow speeds, you can configure DNF to use more parallel downloads. See our guide on increasing DNF speed on Fedora for optimization options.

Remove Remi Repository and Packages

If you no longer need the Remi repository or want to return to Fedora’s default packages, follow these steps to cleanly remove it.

Remove Packages Installed from Remi

First, remove any packages you installed from Remi. To remove PHP:

sudo dnf remove php php-cli php-common
sudo dnf module reset php -y

Next, to remove Redis:

Redis stores data in /var/lib/redis/. If you want to preserve your cached data or RDB snapshots, back up this directory before removing the package. The removal command below does not delete this directory automatically.

sudo systemctl disable --now redis
sudo dnf remove redis
sudo dnf module reset redis -y

Finally, to remove Memcached:

sudo systemctl disable --now memcached
sudo dnf remove memcached

Remove the Remi Repository

After removing the packages, remove the Remi release package to disable the repository:

sudo dnf remove remi-release
sudo dnf clean all

Verify the repository is no longer listed:

dnf repolist | grep remi

This command should produce no output, confirming the Remi repository has been removed from your system.

Conclusion

You now have the Remi repository configured on Fedora with access to multiple PHP versions and Redis. The modular approach allows switching PHP versions without complex reconfiguration, and the dynamic installation command ensures compatibility across Fedora releases. For web server integration, pair PHP with Nginx or Apache using PHP-FPM, and consider Memcached for session storage or object caching to improve application performance.

Leave a Comment