温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

centos7如何重新安装php7.2

发布时间:2021-12-31 10:05:18 来源:亿速云 阅读:428 作者:小新 栏目:编程语言

小编给大家分享一下centos7如何重新安装php7.2,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!

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

centos7如何重新安装php7.2

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

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

安装php yum源

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

清理 旧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-xml

php-fpm开机自启

systemctl enable php-fpm

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

以上是“centos7如何重新安装php7.2”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注亿速云行业资讯频道!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI