1.移除舊 PHP
yum remove -y php*
2.重新裝 Remi repo(強制覆蓋)
rpm -Uvh --force https://rpms.remirepo.net/enterprise/remi-release-7.rpm
3.確認 remi repo 檔案存在
ls /etc/yum.repos.d/remi*.repo
4.啟用 PHP 8.0 repo
yum-config-manager --disable 'remi-php*'
yum-config-manager --enable remi-php82
5.清理並更新快取
yum clean all
yum makecache fast
6.安裝 PHP 8.2
yum --enablerepo=remi-php82 install -y php php-cli php-common php-intl php-mbstring
7.驗證
php -v
yum --enablerepo=remi-php82 install -y php-fpm
systemctl enable php-fpm
systemctl start php-fpm
systemctl status php-fpm