腾讯云服务器安装PHP(CentOS Linux release 7.6.1810)
作者:互联网
操作系统:腾讯云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 #显示启动失败的服务
标签:1810,CentOS,service,systemctl,7.6,release,yum,rpm 来源: https://www.cnblogs.com/wangzhouyi/p/12096035.html