卸载所有已安装的php
yum remove -y php*
执行
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpmrpm -Uvh https://rpms.remirepo.net/enterprise/remi-release-7.rpm
单独安装php8.2
yum-config-manager --disable 'remi-php*'yum-config-manager --enable remi-php82
- 安装php以及扩展
yum install -y php php-bcmath php-cli php-common php-devel php-fpm php-gd php-intl php-ldap php-mbstring php-mysqlnd php-odbc php-pdo php-pear php-pecl-xmlrpc php-pecl-zip php-process php-snmp php-soap php-sodium php-xml
重启apache,到phpinfo中查看php版本
systemctl restart httpd
来源地址:https://blog.csdn.net/qq_45026664/article/details/129401991