CentOS7 网站实例PHP+mariadb+apache
清空防火墙或者关闭防火墙
iptables -F
安装apache服务,并启动
yum install -y httpd
systemctl start httpd.service
systemctl enable httpd.service
安装Maria DB数据库,并启动
#安装
yum install -y mariadb-server
#启动
systemctl start mariadb.service
#设置自动启动
systemctl enable mariadb.service
#对数据库进行安全配置,刚开始会让输入原密码,直接回车即可
mysql_secure_installation
#登录数据库
mysql -uroot -p
#创建数据库
create database 数据库名;
部署PHP
yum install epel-release
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum install php72w
yum -y install php72w-cli php72w-common php72w-devel php72w-mysql
php -v
systemctl restart httpd.service