一、安装php7(https://www.jianshu.com/p/0cc233cd880f)
1、rpm安装PHP7相应的yum源
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
2、yum安装PHP7
yum install php70w
3、安装其他插件
yum install php70w-pdo
yum install php70w-pdo_mysql
yum install php70w-json
yum install php70w-filter
yum install php70w-openssl
yum install php70w-mbstring
yum install php70w-zlib
yum install php70w-curl
yum install php70w-gd
yum install php70w-iconv
二、安装Apache
1、检查是否安装过apache
rpm -qa | grep httpd
若没有安装则继续安装:
2、安装apache
yum install httpd-devel.x86_64
3、启动apache服务
systemctl restart httpd.service
注意事项:
(1)这里若是启动失败,注意查看防火墙是否关闭,若没关闭,执行下列语句
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload
(2)若提示端口被占用,杀掉占用端口的进程或者是修改apache配置文件
vi /etc/httpd/conf/httpd.conf
ServerName 192.168.52.131:8989
Listen 8989
当然这里不一定非要设置为8989端口,也可以设置其他的没被占用的端口。
三、安装mysql5.7
参见网上安装教程