如何对CentOS 7系统进行PHP 7.2的重新安装操作?

更新于
2026-09-25 19:58:24
1阅读来源:SEO资讯
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计398个文字,预计阅读时间需要2分钟。

如何对CentOS 7系统进行PHP 7.2的重新安装操作?

CentOS 7 重装 PHP 7.2 的方法:

1.使用 `yum -y remove php*` 清理旧版 PHP;

2.查看 `yum list available php` 查找可安装的 PHP 版本;

3.安装 PHP 7.2 的精简版:`yum install php72w`;

4.设置 PHP-FPM 开机自启:`systemctl enable php-fpm.service`。

centos7重新安装php7.2的方法:1、通过“yum -y remove php*”清理旧php;2、查看可以安装的php版本;3、安装php精简拓展;4、设置php-fpm开机自启即可。

本文操作环境:centos7系统、PHP7.2版、DELL G3电脑

centos7怎么重新安装php7.2?

Centos7安装PHP7.2

建议方法

# 安装EPEL yum存储库 yum install epel-release -y # 安装Remi存储库 rpm -Uvh 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安装php yum源

# 方法一: rpm -Uvh dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -Uvh mirror.webtatic.com/yum/el7/webtatic-release.rpm # 方法二: yum install epel-release -y rpm -Uvh mirror.webtatic.com/yum/el7/webtatic-release.rpm清理 旧php

yum -y remove php*查看可以安装的php版本

yum list php*安装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-xmlphp-fpm开机自启

systemctl enable php-fpm

这种安装方法 可能会出现 yum info php与 php -v 两条命令 显示的php版本不同

如何对CentOS 7系统进行PHP 7.2的重新安装操作?

推荐学习:《PHP视频教程》

本文共计398个文字,预计阅读时间需要2分钟。

如何对CentOS 7系统进行PHP 7.2的重新安装操作?

CentOS 7 重装 PHP 7.2 的方法:

1.使用 `yum -y remove php*` 清理旧版 PHP;

2.查看 `yum list available php` 查找可安装的 PHP 版本;

3.安装 PHP 7.2 的精简版:`yum install php72w`;

4.设置 PHP-FPM 开机自启:`systemctl enable php-fpm.service`。

centos7重新安装php7.2的方法:1、通过“yum -y remove php*”清理旧php;2、查看可以安装的php版本;3、安装php精简拓展;4、设置php-fpm开机自启即可。

本文操作环境:centos7系统、PHP7.2版、DELL G3电脑

centos7怎么重新安装php7.2?

Centos7安装PHP7.2

建议方法

# 安装EPEL yum存储库 yum install epel-release -y # 安装Remi存储库 rpm -Uvh 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安装php yum源

# 方法一: rpm -Uvh dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -Uvh mirror.webtatic.com/yum/el7/webtatic-release.rpm # 方法二: yum install epel-release -y rpm -Uvh mirror.webtatic.com/yum/el7/webtatic-release.rpm清理 旧php

yum -y remove php*查看可以安装的php版本

yum list php*安装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-xmlphp-fpm开机自启

systemctl enable php-fpm

这种安装方法 可能会出现 yum info php与 php -v 两条命令 显示的php版本不同

如何对CentOS 7系统进行PHP 7.2的重新安装操作?

推荐学习:《PHP视频教程》