centos安装php72

2020-03-10  本文已影响0人  Chting

1.如果旧版本先卸载

查看
rpm -qa|grep php  
##清除
yum remove php-*   

2.更新yum源

##安装 EPEL 软件包:
yum install epel-release

##安装 remi 源:
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
##安装 yum 扩展包
yum install yum-utils

##启用 remi 仓库:
yum-config-manager --enable remi-php72
yum update

3.安装php72
···
yum -y install php72 php72-php-fpm php72-php-gd php72-php-json php72-php-mbstring php72-php-mysqlnd php72-php-xml php72-php-xmlrpc php72-php-opcache
···

4.配置php-fpm

##开启服务
 systemctl start php-fpm.service
# 停止服务
systemctl stop php-fpm.service
# 查看状态
systemctl status php-fpm.service

##设置开机自启
systemctl enable php-fpm.service
  1. 简单模式
yum -y remove 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 -y install php72w php72w-cli php72w-common php72w-devel php72w-embedded php72w-fpm php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml
上一篇下一篇

猜你喜欢

热点阅读