How to change default php version in DNF module list php in Centos 8
Login | Register RSS
11/13/2024 - Linux 

How to change default php version in DNF module list php in Centos 8

This example is for the Remi Repo, however the command is the same for others but the module might be under a different header/name. You can likely figure it out for your existing repo by looking at the list of available PHP modules on your CentOS installation using this command:

dnf module list php

It is best to update to the latest stable PHP version which at the moment is version 8.1.

Assuming you have it installed with all the desired modules, on CentOS Stream 8 the command to enable the Remi Repo PHP version 8.3 is:

dnf module switch-to php:remi-8.3

.. based on what you posted above, the command might be:

dnf module switch-to php:8.3

To determine which PHP version is being used by default, use this command:

php -v

If you set your webserver to use PHP-FPM, it will use the default version automatically.


If you like this site or any of its content, please help promote it. Use the social media buttons below to help spread the word. Don't forget to post in the comments section.

  Print   Email