腾讯云服务器安装PHP(CentOS Linux release 7.6.1810)

坚强是说给别人听的谎言 提交于 2019-12-25 12:51:21

操作系统:腾讯云CentOS Linux release 7.6.1810 (Core)

cat /etc/centos-release    //查看系统版本

一、先检查以前有没有安装的版本,如果有删除之前的 php 版本:

yum remove php* php-common

二、rpm 安装 Php7 相应的 yum源

CentOS/RHEL 7.x:

1 rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
2 rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

CentOS/RHEL 6.x:

rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

 

 

 可以用yum search php7查看下安装源的版本

yum search php7

 

 

 看来最新的是php72w,下来就开始安装吧

三、安装PHP

yum install php72w

 

 

 四、常用systemctl指令:

systemctl enable *.service #开机运行服务
systemctl disable *.service #取消开机运行
systemctl start *.service #启动服务
systemctl stop *.service #停止服务
systemctl restart *.service #重启服务
systemctl reload *.service #重新加载服务配置文件
systemctl status *.service #查询服务运行状态
systemctl --failed #显示启动失败的服务
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!