临时关闭防火墙
setenforce 0
永久关闭防火墙
/etc/selinux/config
selinux=enforcing 改 disabled
如果yum被自动更新锁定
rm -f /var/run/yum.pid
apache
yum -y install httpd
systemctl start httpd.service
mysql-server
https://downloads.mysql.com/archives/community/
1.下载mysql(bundle版本) 解压到lamp文件夹下
2.卸载centos自带的mariadb 会和mysql冲突
yum remove mariadb-libs*
3.rpm ivh common.rpm
rpm ivh libs.rpm
compat
client
server
devel
RPM -ivh
i:install
v:过程
h:进度
4.空目录登录
vi /etc/my.cnf
添加 skip-grant-tables //跳过密码验证
5.mysql目录
/etc/init.d/
systemctl start mysqld.service
6.验证mysql安装
mysql -u root -p 密码
7.php
yum -y install php
yum -y install php-fpm //进程管理器
yum -y install php-fpm-D //进程管理器守护进程
yum -y install php-mysql //配合mysql
为了正确调用php
/etc/httpd/conf/httpd.conf
在index.html 前面加index.php
AddType application/x-httpd-php .php
重启php-fpm
systemctl restart php-fpm.service
重启apache和mysql
systemctl restart mysqld.service
systemctl restart httpd.service
8.拷贝源码 赋予权限
拷贝源码到根目录 /var/www/html
赋予权限 chmod -R 777 /var/www/html/build