一、yum源文件更新
yum -y update
二、安装PHP7
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum install php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-mysql.x86_64 php70w-pdo.x86_64
三、安装PHP FPM
yum install php70w-fpm
systemctl start php-fpm.service
设置开机启动
systemctl enable php-fpm.service
四、安装Apache
yum install httpd
systemctl enable httpd
systemctl start httpd
五、安装MySQL7
wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
yum localinstall mysql57-community-release-el7-8.noarch.rpm
yum install mysql-community-server
systemctl start mysqld
systemctl enable mysqld
查看MySQL7初始化密码
grep 'temporary password' /var/log/mysqld.log
![9854d04a123c80342c6d71f86f4aeede.png](https://img-blog.csdnimg.cn/img_convert/9854d04a123c80342c6d71f86f4aeede.png)
mysql -u root -p
输入密码登录
修改初始密码
ALTER USER 'root'@'localhost' IDENTIFIED BY '新密码!';
设置远程链接权限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;
重启生效
systemctl restart mysqld
六、安装phpMyadmin
yum yum install phpmyadmin
修改phpmyadmin配置文件
vi /etc/httpd/conf.d/phpMyAdmin.conf
![390ea6c9f5de4ef386a73faf58a94de2.png](https://img-blog.csdnimg.cn/img_convert/390ea6c9f5de4ef386a73faf58a94de2.png)
保存配置退出
重启Apache
systemctl restart httpd
PHPmyadmin访问地址:http://服务器IP地址或域名/phpmyadmin/
![cf6e906b305e21bda207c1122627d7de.png](https://img-blog.csdnimg.cn/img_convert/cf6e906b305e21bda207c1122627d7de.png)