CentOS7.4 yum 安装 Apache php5.6 或者 php7

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

安装Apache

yum install httpd

常用命令

#设置开机启动:
systemctl enable httpd.service
#启动服务:
systemctl start httpd.service
#停止服务:
systemctl stop httpd.service
#重启服务:
systemctl reload httpd.service

安装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 search php

# php7安装以及扩展
yum install php71w php71w-fpm php71w-cli php71w-common php71w-devel php71w-gd php71w-pdo php71w-mysql php71w-mbstring php71w-bcmath
# 或者安装php5.6以及扩展

yum install php56w php56w-fpm php56w-cli php56w-common php56w-devel php56w-gd php56w-pdo php56w-mysql php56w-mbstring php56w-bcmath

# 重启httpd服务
systemctl reload httpd.service

转载于:https://my.oschina.net/u/3148025/blog/2873890

你可能感兴趣的:(CentOS7.4 yum 安装 Apache php5.6 或者 php7)