1.卸载所有已安装的php
yum remove -y php*
2.执行
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://rpms.remirepo.net/enterprise/remi-release-7.rpm
3.单独安装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
5.重启apache,到phpinfo中查看php版本
systemctl restart httpd