How to install PHP 8.5.3 from Remi on RHEL, Rocky, Alma and Fedora
The latest Remi packages bring PHP 8.5.3 (and the maintenance‑only 8.4.18) to RHEL, Rocky Linux, AlmaLinux 8‑10 and Fedora 42 and higher. This guide shows how to pull those RPMs from the remi-modular repository, replace the system PHP if you want, or run them side‑by‑side as Software Collections.
Why use Remi’s repo instead of the distro default
The stock PHP versions in RHEL 8 and Fedora 42 are stuck at 7.x or early 8.0, which means missing modern syntax, JIT improvements, and newer extensions. Remi builds the same binaries you’d get from php.net but packages them for dnf/yum, complete with intl‑74, mbstring oniguruma5php, and OCI8 linked to Oracle Instant Client 23.26. In practice this saves a lot of “compile‑my‑own” headaches.
A common scenario: after a routine yum update on a CentOS 8 server, a legacy web app started throwing “Call to undefined function str_contains()”. The culprit was the OS still shipping PHP 7.4 while the code had already been upgraded to require PHP 8 features. Switching the module to Remi’s 8.5 instantly restored compatibility without touching the application.
Enabling the remi‑modular repository
First, make sure the repository is present. On any EL‑based system:
dnf install https://rpms.remirepo.org/remi-release-$(rpm -E %dist).rpm
The package adds three repos: remi-safe, remi-modular and a disabled remi. Only the modular one is needed for version switches.
Replacing the default PHP with 8.5 (the simplest path)
On Enterprise Linux that uses dnf 4 (RHEL, AlmaLinux, Rocky, etc.):
dnf module switch-to php:remi-8.5/common
The switch-to command tells the module system to forget any previously enabled stream and adopt Remi’s 8.5. The “common” profile pulls a basic set of extensions; additional ones can be added later with dnf install php-<ext>.
On Fedora 42 and higher, which ships dnf 5:
dnf module reset php dnf module enable php:remi-8.5 dnf update
Resetting clears the default stream (usually “php:stable”), then enabling picks Remi’s 8.5 stream. The final update pulls the new binaries and updates the dependency graph.
Why each step matters: resetting avoids a conflict where two streams try to provide the same files, while enable registers the correct version before the resolver runs.
Parallel installation via Software Collections
If you need multiple PHP versions on the same host (e.g., a legacy app stuck on 8.4), the Software Collection packages let you keep them side‑by‑side:
yum install php85 # pulls PHP 8.5 as an SCL yum install php84 # pulls PHP 8.4 as an SCL
After installation, run a specific version with scl enable php85 'php -v' or configure your web server to point at /opt/remi/php85/root/usr/bin/php. This approach isolates extensions per version and avoids the module switch‑over entirely.
Common pitfalls and how to avoid them
- Missing architecture – The RPMs are built for x86_64 and aarch64. Trying to install on i386 will fail with “no package … available”. Verify uname -m before proceeding.
- Old intl library – Remi now uses libicu 74 (version 74.2). If you have a custom php.ini that hard‑codes the ICU version, update it; otherwise you’ll see warnings about missing symbols at startup.
- OCI8 linkage – The OCI8 extension now depends on Oracle Instant Client 23.26 RPMs. Installing php-oci8 without those client packages will leave the module disabled. Pull them with dnf install oracle-instantclient23.*.
- Module cache stale after repo changes – Run dnf clean all && dnf makecache if the new stream doesn’t appear in dnf module list php.
When to stick with the distro’s PHP
If your workload is locked to an older framework that hasn’t been tested on PHP 8, or you’re running a minimal container where every extra package adds bloat, staying on the default version can be safer. Remi’s builds are solid, but they do introduce newer ABI requirements that some legacy extensions may not yet support.
That’s it – with the repository enabled and the appropriate module command run, your RHEL or Fedora box will be serving PHP 8.5.3 (or 8.4.18) without a single source compile.
