LNMP环境搭建 mysql5.7.20+nginx1.13.7+php7.1.12

来源:互联网 发布:centos中文乱码 编辑:程序博客网 时间:2024/05/21 18:36

1.首先安装依赖包

[root@localhost ~]# yum -y install gcc[root@localhost ~]# yum -y install gcc++[root@localhost ~]# yum -y install gcc-c++[root@localhost ~]# yum -y install wget[root@localhost ~]# yum -y install make[root@localhost ~]# yum -y install libxml2 [root@localhost ~]# yum -y install libxml2-devel [root@localhost ~]# yum -y install openssl [root@localhost ~]# yum -y install openssl-devel [root@localhost ~]# yum -y install curl-devel [root@localhost ~]# yum -y install libjpeg-devel [root@localhost ~]# yum -y install libpng-devel[root@localhost ~]# yum -y install freetype-devel[root@localhost ~]# yum -y install bison[root@localhost ~]# yum -y install autoconf

LNMP安装主要参考博客:https://www.cnblogs.com/evai/p/5990583.html 


nginx的安装(主要参考博客:http://blog.csdn.net/likelxl/article/details/69808742)

我安装的是http://nginx.org/en/download.html 中的nginx-1.13.7版本

安装nginx之前需要先编译安装:

wget https://www.openssl.org/source/openssl-1.1.0f.tar.gz(这个不需要编译,只解压并进入源文件进行一下 ./configure 就可以) 

wget https://ftp.pcre.org/pub/pcre/pcre-8.39.tar.bz

wget http://www.zlib.net/zlib-1.2.11.tar.gz


PHP7.1.12的安装配置

PHP7.1.12编译安装后,我的配置文件的位置:

# cp php.ini-development /usr/local/php/lib/php.ini

# cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf

# cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf

# cp -R ./sapi/fpm/php-fpm /etc/init.d/php-fpm