我是阿里云centos 7.3
安装apache
yum install httpd httpd-devel
启动apache服务
systemctl start httpd
设置httpd服务开机启动
systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
启动mysql
systemctl start mysqld
查看mysql 状态
systemctl status mysqld
开机启动
systemctl enable mysqld
systemctl daemon-reload
修改root默认密码
找到mysql默认密码
grep 'temporary password' /var/log/mysqld.log
登录修改默认密码
mysql -uroot -p
set password for 'root'@'localhost'=password('Zxc74110..');
密码设置必须有
大小写字母、数字和特殊符号,并且长度不能少于8位。否则会提示ERROR 1819 (HY000): Your password does not satisfy the current policy requirements错误
修改mysql 远程登录 (不设置远程访问不了)
use mysql;
(这里修改的root用户远程登录,也可以修改其他用户远程登录权限)
update user set host = '%' where user = 'root' limit 1 ;
flush privileges (刷新权限)
安装php
查看php相关安装包
yum list installed | grep php
清理之前的php
yum -y remove php
更换RPM源
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
安装php 及拓展
yum -y install php72w php72w-cli php72w-fpm php72w-common php72w-devel php72w-embedded php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml
启动php-fpm服务
systemctl enable php-fpm.service
systemctl start php-fpm.service
ok 完成