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

How to reinstall php7.2 on centos7

藏色散人
Release: 2023-02-18 09:54:01
Original
3723 people have browsed it

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
Copy after login

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
Copy after login

Clean up old php

yum -y remove php*
Copy after login

Check the php version that can be installed

yum list php*
Copy after login

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
Copy after login

php-fpm starts automatically after booting

systemctl enable php-fpm
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template