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

安裝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
相關文章
相關標籤/搜索