Installed package put PHP in /usr/bin
You manually build version is in /usr/local/bin
"php -m" use the first version found (according to PATH order)
So "rm /usr/local/bin/php" (and probably some other stuff in /usr/local, but I can't know how much your system is messy)
And you will always use the packaged version, which can be extended if missing modules (yum install php-xxx) and will be updated on next version (yum update)
Laptop: Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi