Your 7.4 installation apparently came from the multi package so remove that one too. Eliminate PHP entirely for a clean start. Try to get rid of all extra extensions and modules. dnf search/check/info can help narrow down leftovers. Sometimes the command history helps with recall.
Decide which PHP version you prefer for the default system installation, i.e., the one that uses /etc/php.ini. In theory, you don’t need a system PHP but I’ve never used it that way and can’t give adequate advice, nor would I recommend it. For my CentOS 8 installation I’m sticking with 7.2 from the CentOS repo and will add 7.3 from Remi eventually. I don’t want more than two PHPs to manage for my light requirements.
Since you’re starting fresh with Remi’s repositories enabled, you could be getting all PHP packages from there, from 5.6 to 7.4 to 8.x beta. If you go that route, for extra measure I suggest adding an exclusion in the CentOS Appstream repo to avoid any collisions.
If you prefer 7.3 or 7.4 for the system you’ll have to get them from Remi. Use the wizard and select ‘Default/Single version’ and follow instructions. Once installed its php.ini file will end up in /etc and php -v will output 7.3 or 7.4. For system PHP all *.ini files for various extensions and modules are in /etc/php.d.
For add-on PHP versions select ‘Multiple versions simultaneously’ with the Remi wizard and follow instructions.
Sorry, I’m drawing a blank on where add-on versions stash their php.ini files. Before I started using Webmin my CentOS 7 server stored them in /etc/opt/remi/73 and /etc/opt/remi/74… best I can recall. I do know you’ll find user.ini files in Virtualmin home directories for extra tuning per user. A phpinfo() file in a user’s public_html loaded in a browser will tell you all paths; or type /usr/bin/php73 -i for a big ugly screen dump with every detail.
It’s no less tricky installing packages for system and multi-PHP installations.
dnf install php-[pkg-name]
dnf install phpNN-php-[pkg-name]
- installs to a specific multi-PHP installation where NN is the version number.
So there’s a big difference in how to install the two packages that gave you grief, depending on how PHP 7.4 was installed in the first place.
dnf install php-gd
dnf install php74-php-gd
dnf install php-pecl-imagick
dnf install php74-php-pecl-imagick
I think you should approach this by getting system PHP fully installed first along with all extensions. Then take on any multi versions.