Skip to content

Did you know?

On RHEL 10, the AppStream PHP 8.4 packages replace PHP 8.3 instead of installing beside it.

Add --allowerasing to swap the packages in one step, or use Remi's php84 packages to keep both.

  • Packages
  • Applies to RHEL 10, Rocky Linux 10, AlmaLinux 10
  • Last checked

Explained

RHEL 10 and its rebuilds (Rocky Linux, AlmaLinux, CentOS Stream 10) dropped DNF modules. The default php packages are PHP 8.3, and PHP 8.4 comes as a second set named php8.4-*. Both provide the same php command and php-fpm service, so with 8.3 installed, a normal install fails:

package php8.4-cli-8.4.27-1.el10_2.x86_64 from appstream conflicts with php-cli < 8.4 provided by php-cli-8.3.36-1.el10_2.x86_64

Add --allowerasing and list the extensions you use, so dnf swaps every 8.3 package for its 8.4 counterpart in one transaction:

sudo dnf install --allowerasing php8.4 php8.4-cli php8.4-fpm php8.4-mysqlnd

To go back, run the same with the unprefixed php package names. If you need 8.3 and 8.4 at the same time, use the parallel packages from the Remi repository, such as php84-php-cli, which install under /opt/remi.

Learn more

← All tech tips · Suggest a fix

Back to top