Centos 8’s default php version is 7.2 , while some WordPress plugins and themes need 7.4 or higher version, here is upgrade instructions.
remove old php and enable php 8.2 module
#dnf module list php
#dnf remove "php*"
#dnf module reset php -y
#dnf module enable php:8.2 -y
#dnf module switch-to php:8.2 -y
#dnf module list php
reinstall php and restart services
#dnf install php php-{cli,common,gd,fpm,mbstring,xml,json,intl,zip,mysqlnd,ldap,pgsql,devel,apcu,posix,soap,snmp,odbc,gmp,enchant,dba,bcmath}
#systemctl restart nginx
list php installed module
#php -m
modify /etc/php-fpm.d/www.conf again, swith php-fpm back to nginx user, because it is changed to apache.
user = nginx
group = nginx
restart php-fpm , this will make php-fpm have access to nginx’s folder.
#systemctl restart php-fpm
Test upgraded php will send mail or not ?