Reference Address: http://www.cnblogs.com/htian/p/5728599.html
Go to the official website to find pcre and download http://www.pcre.org/
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre2-10.21.tar.gz
Decompression: TAR-XZVF pcre.tar.gz
Go to Pcre directory: CD pcre
Installing Pcre
./configure--prefix/usr/local/pcre2
Make
Make install
Install Pcre-devel (the module is missing, the installation of Nginx will be error)
Yum Install Pcre-devel
Go to official website Download zlib Library http://www.zlib.net/
wget http://www.zlib.net/zlib-1.2.11.tar.gz
TAR-XZVF zlib-1.2.11.tar.gz
CD zlib-1.2.11
./configure--prefix/usr/local/zlib
Make
Make install
Go to the official website to download openssl:https://www.openssl.org/
wget https://www.openssl.org/source/openssl-1.0.2l.tar.gz
TAR-XZVF openssl-1.0.2l.tar.gz
CD openssl-1.0.2l
./config
Make
Make install
Go to the official website to download nginx:http://nginx.org/en/
Nginx Source Installation Documentation: http://nginx.org/en/docs/configure.html
wget http://nginx.org/download/nginx-1.13.2.tar.gz
TAR-XZVF nginx-1.13.2.tar.gz
CD nginx-1.13.2
./configure--sbin-path=/usr/local/nginx--conf-path=/usr/local/nginx/nginx.conf--pid-path=/usr/local/nginx/ Nginx.pid--with-pcre=/home/lyh/download/pcre2-10.21--with-zlib=/home/lyh/download/zlib-1.2.11--with-openssl=/ home/lyh/download/openssl-1.0.2l
Make
Make install
Above--sbin-path= is the path that Nginx installs to, can customize; --conf-path= and--pid-path= Please refer to your own definition of the directory to fill in,--with-pcre= and--with-zlib=,--with-openssl is just the download of the compressed package extracted from the directory, Fill in according to your own file name
Compile and install Nginx+mysql +php in CentOS (not finished)