关闭防火墙

安装依赖包
bash
yum -y install pcre-devel zlib-devel gcc gcc-c++ make
创建运行用户、组

编译安装Nginx


让系统识别nginx的操作命令

添加Nginx系统服务
bash
vim /lib/systemd/system/nginx.service


编译安装mysql
安装Mysql环境依赖包

创建运行用户

编译安装
bash
cd /opt
tar zxvf mysql-boost-5.7.20.tar.gz



修改mysql 配置文件

更改mysql安装目录和配置文件的属主属组

设置路径环境变量

初始化数据库

添加mysqld系统服务

修改mysql 的登录密码

授权远程登录
mysql -u root -p
php的编译安装
安装环境依赖包

编译安装
bash
cd /opt
tar jxvf php-7.1.10.tar.bz2



路径优化
ln -s /usr/local/php/bin/* /usr/local/bin/
ln -s /usr/local/php/sbin/* /usr/local/sbin/

调整PHP配置文件
php有三个配置文件:
php.ini 主配置文件
php-fpm.conf 进程服务配置文件
www.conf 扩展配置文件
调整主配置文件
bash
cp /opt/php-7.1.10/php.ini-development /usr/local/php/lib/php.ini
vim /usr/local/php/lib/php.ini


php -m 验证模块
调整进程服务配置文件
bash
cd /usr/local/php/etc/
cp php-fpm.conf.default php-fpm.conf
vim php-fpm.conf

调整扩展配置文件
bash
cd /usr/local/php/etc/php-fpm.d/
cp www.conf.default www.conf
启动php-fpm


配置 Nginx 支持 PHP 解析
bash
vim /usr/local/nginx/conf/nginx.conf

验证数据库工作是否正常

