腾讯云服务器安装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 *