腾讯云CentOS7.2 配置PHP7 MySQL
服务器系统 :CentOS7.2
查看系统版本:
cat /etc/centos-release //CentOS Linux release 7.2.1511 (Core) - 1
删除之前的 php 版本:
yum remove php* php-common- 1
rpm 安装 Php7 相应的 yum源
CentOS/RHEL 7.x:
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- 1
- 2
CentOS/RHEL 6.x:
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm- 1
直接yum安装php7:
yum install php70w - 1
重启服务:
systemctl restart httpd.service- 1
下为systemctl指令:
systemctl enable *.service #开机运行服务
systemctl disable *.service #取消开机运行
systemctl start *.service #启动服务
systemctl stop *.service #停止服务
systemctl restart *.service #重启服务
systemctl reload *.service #重新加载服务配置文件
systemctl status *.service #查询服务运行状态
systemctl --failed #显示启动失败的服务- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
安装MySQL:
下载mysql的repo源:
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm- 1
安装mysql-community-release-el7-5.noarch.rpm包:
sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm- 1
安装mysql:
sudo yum install mysql-server- 1
开启MySQL:
systemctl start mysql- 1
重置密码:
/bin/mysqladmin -u root -p password
//Enter password : 为空
//New password: 新密码
//Confirm new password: 新密码
本文介绍如何在CentOS7.2上配置PHP7与MySQL服务器,包括删除旧版PHP、安装PHP7及设置相应的YUM源,以及安装和启动MySQL服务。
1377





