Home > Article > Backend Development > How to reinstall php7.2 on centos7
How to reinstall php7.2 in centos7: 1. Clean the old php through "yum -y remove php*"; 2. Check the php version that can be installed; 3. Install php streamlined extension; 4. Set up php -fpm can start automatically after booting.
The operating environment of this article: centos7 system, PHP7.2 version, DELL G3 computer
How to reinstall php7.2 in centos7?
Centos7 install PHP7.2
# 安装EPEL yum存储库 yum install epel-release -y # 安装Remi存储库 rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm # 安装 PHP 7.3 yum --enablerepo=remi-php73 install php # 安装 PHP 7.2 yum --enablerepo=remi-php72 install php # 安装 PHP 7.1 yum --enablerepo=remi-php71 install php
# 方法一: rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm # 方法二: yum install epel-release -y rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum -y remove php*
yum list php*
yum -y install php72w php72w-cli php72w-fpm php72w-common php72w-devel # 也可以安装 豪华版拓展 yum -y install php72w php72w-cli php72w-fpm php72w-common php72w-devel php72w-embedded php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml
systemctl enable php-fpm
This installation method may cause problems yum info php and php -v The php versions displayed by the two commands are different
Recommended study: "PHP Video Tutorial》
The above is the detailed content of How to reinstall php7.2 on centos7. For more information, please follow other related articles on the PHP Chinese website!