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 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
这种安装方法 可能会出现 yum info php与 php -v 两条命令 显示的php版本不同
立即学习“PHP免费学习笔记(深入)”;
推荐学习:《PHP视频教程》
以上就是centos7怎么重新安装php7.2的详细内容,更多请关注php中文网其它相关文章!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号