安装所需要的的依赖库
```
[root@localhost lnmp]# yum install gcc gcc-c++ automake pcre pcre-devel zlib zlib-devel openssl openssl-devel libxml2-devel libpng-devel curl-devel numactl wget
tar make
```
关闭selinux
```
[root@localhost lnmp]# setenforce 0
```
新建目录用于存放安装文件,及安装文件编译。
```
[root@localhost home]# cd /home
[root@localhost home]# mkdir lnmp
[root@localhost home]# cd lnmp
```
约定的安装目录:
```
/usr/local/nginx nginx服务器安装目录
/usr/local/php php安装目录
/usr/local/mysql mysql数据库安装目录
```