Home  >  Article  >  Backend Development  >  How to reinstall php7.2 on centos7

How to reinstall php7.2 on centos7

藏色散人
藏色散人Original
2021-12-31 09:52:123649browse

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.

How to reinstall php7.2 on centos7

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

Suggested method

 # 安装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

Install php yum source

# 方法一:
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

Clean up old php

yum -y remove php*

Check the php version that can be installed

yum list php*

Install php streamlined extension

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

php-fpm starts automatically after booting

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn