How do I restore a php install?

,

Since I need several versions of php installed on my Fedora 39, I tried to install php 7.4 from the remi repository. I succeeded but in the process I erased the php 8.0 default install.

Now, dnf info php just returns:

Name         : php
Version      : 7.4.33
Release      : 15.fc39.remi
Architecture : x86_64
Size         : 9.2 M
Source       : php-7.4.33-15.fc39.remi.src.rpm
Repository   : @System
From repo    : remi-modular
.....

and somehow I don’t get any info about either php or php-cli from the Fedora repositories, tough dnf repolist returns:

repo id                                                                              repo name
copr:copr.fedorainfracloud.org:phracek:PyCharm                                       Copr repo for PyCharm owned by phracek
fedora                                                                               Fedora 39 - x86_64
fedora-cisco-openh264                                                                Fedora 39 openh264 (From Cisco) - x86_64
google-chrome                                                                        google-chrome
remi                                                                                 Remi's RPM repository - Fedora 39 - x86_64
remi-modular                                                                         Remi's Modular repository - Fedora 39 - x86_64 
rpmfusion-free                                                                       RPM Fusion for Fedora 39 - Free
rpmfusion-free-updates                                                               RPM Fusion for Fedora 39 - Free - Updates
rpmfusion-nonfree                                                                    RPM Fusion for Fedora 39 - Nonfree
rpmfusion-nonfree-nvidia-driver                                                      RPM Fusion for Fedora 39 - Nonfree - NVIDIA Driver
rpmfusion-nonfree-steam                                                              RPM Fusion for Fedora 39 - Nonfree - Steam
rpmfusion-nonfree-updates                                                            RPM Fusion for Fedora 39 - Nonfree - Updates
updates                                                                              Fedora 39 - x86_64 - Updates

I am not sure how to understand it.
I welcome your advises

remi and remi-modular appear to provide packages that overwrite or replace fedora packages. The fact those repos appear before fedora’s updates repo may mask whatever is available from fedora, but using dnf list php* should show what is installed and what is available.

Be careful using modular packages. Fedora completely discarded the modular paradigm and seems to only use rpms for everything.

sudo dnf module disable php
sudo dnf distro-sync

As far as I know, you can install different versions of PHP from remi repository. And they should be installed under /opt/remi

Do you remember the steps you performed? Maybe you used modules?
sudo dnf module install php:remi-7.4
If so, follow @vgaetera suggestion, and you will be back to default.

For a proper repository configuration and usage, see the Wizard instructions

For an example of multiple versions installation, read My PHP development Workstation

Yes, it works, thanks so much

Yes, I guess that that was the culprit. Actually, I do not what those modules are :-(.
So, how do I install phpXY from the remi repository, without messing up with modules?

You can perform installs from a single repo with a command like
sudo dnf --disablerepo=\* --enablerepo=remi install <packagename>

:point_down:

Thanks to all.