It's a tough time to play. In addition to the compiler using Yum installation, all others are compiled manually. Hum ~
Seemingly on Nginx, PHP, MySQL three east, but they are too much to rely on others.
There is no way to use them to be honest with them to provide the things they want.
Some of the first modules depend on some Lib libraries,
If you are lazy, just follow the instructions below and enter them separately. Then look directly at the configuration chapter. (But this is not the latest version of the installation of Yo)
Directory
First, Centos7 from zero compile Nginx+php+mysql
Second, Centos7 from zero configuration nginx+php+mysql
Third, Centos7 from the zero compiler configuration memcached
First, the preparatory work
1.1 Installing or updating GCC gcc-c++
Because I installed the CentOS is absolutely pure drops. There's nothing. No more. The compiler must be installed first.
# yum Install gcc gcc-c++
1.2 Creating a directory to use
Source is the folder used to store the source code. The package is used to store the compiled library files. Lnmp is what we really need to put inside. (nginx+mysql+memcached+php)
# mkdir/source/
# mkdir/package/
# mkdir/lnmp/
Second, start the installation (Nginx article)
2.1 Decompression Pcre
[Official website] http://www.pcre.org/
Command flow:
# cd/source/
# wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.38/pcre-8.38.tar.gz# TAR-ZXVF pcre-8.38.tar.gz
Description: Do not need to compile, only need to unzip on the line.
2.2 Decompression Zlib
[Official website] http://zlib.net/
Command flow:
# cd/source/
# wget http://zlib.net/zlib-1.2.8.tar.gz# TAR-ZXVF zlib-1.2.8.tar.gz
Description: Do not need to compile, only need to unzip on the line.
2.3 Installing Nginx
[Official website] http://nginx.org/
Command flow:
# cd/source/
# wget http://nginx.org/download/nginx-1.8.0.tar.gz# tar-zxvf nginx-1.8.0.tar.gz# cd nginx-1.8.0#./configure--prefix =/lnmp/nginx--with-pcre=/source/pcre-8.38--with-zlib=/source/zlib-1.2.8# make# make install
--with-pcre: The source directory used to set up the pcre.
--with-zlib: The source directory used to set up the zlib.
Because compiling nginx needs to use the source code of these two libraries.
Small summary:
Here, the Nginx installation is complete. We can satisfy the desire of our own heart first. Open the Nginx service to see Hello World.
Start Nginx
#/lnmp/nginx/sbin/nginx
After launch, you can open the page in the browser and the Nginx default page will be displayed.
Third, start the installation (PHP article)
3.1 Installing LIBXML2
[Official website] http://xmlsoft.org/
Command flow:
# cd/source/
# wget ftp://xmlsoft.org/libxml2/libxml2-2.9.3.tar.gz# tar-zxvf libxml2-2.9.3.tar.gz# cd libxml2-2.9.3#./configure #- -PREFIX=/PACKAGE/LIBXML2--with-python=no# make# make install
Here--with-python=no is
3.2 Installing PHP
[Official website] http://php.net/
Command flow:
# cd/source/# wget http://cn2.php.net/distributions/php-7.0.2.tar.gz# tar-zxvf php-7.0.2.tar.gz# cd php-7.0.2#./ Configure #--prefix=/lnmp/php #--WITH-LIBXML-DIR=/PACKAGE/LIBXML2 \/ /Open support for LIBXML2 Library #-- WITH-CONFIG-FILE-PATH=/LNMP/PHP/ETC \//config file directory #--enable-mbstring \/ /Support mbstring Library #--ENABLE-FPM \/ / Support PHP-FPM (recommended to open) #--with-mysqli //Open mysqli Module # make# make install
Iv. start installation (MySQL article)
4.1 Installing CMake
[Official website] https://cmake.org/
Command flow:
# wget https://cmake.org/files/v3.4/cmake-3.4.1.tar.gz# tar-zxvf cmake-3.4.1.tar.gz# cd cmake-3.4.1#./configure-- prefix=/package/cmake# make# make install# export path=/package/cmake/bin: $PATH //SET environment variable. Can be ignored, just for your later use CMake convenient point.
4.2 Installing ncurses
[Official website] http://ftp.gnu.org/gnu/ncurses/
Command flow:
# wget http://ftp.gnu.org/gnu/ncurses/ncurses-6.0.tar.gz# tar-zxvf ncurses-6.0.tar.gz# cd ncurses-6.0#./configure-- prefix=/package/ncurese# make# make Install
4.3 Installing MySQL
[Official website] http://www.mysql.com/
Command flow:
Without boost mounting mode
This is the MySQL source without the boost version. You can use the following parameters to download the boost//-ddownload_boost=1-dwith_boost=/package/boost# wget automatically during the compilation process http://cdn.mysql.com/Downloads/ mysql-5.7/mysql-5.7.10.tar.gz# tar-zxvf mysql-5.7.10.tar.gz# cd mysql-5.7.10# cmake.-dcmake_install_prefix=/ Usr/local/mysql #-ddownload_boost=1-dwith_boost=/package/boost \/ /set to automatically download the BOOST library and put it in the-dwith_boost specified path. #-DCURSES_LIBRARY=/PACKAGE/NCURSES/LIB/LIBNCURSES.A \ //ncurses Library libncurses.a#-dcurses_include_path=/package /ncurses/include //ncurses Library header file # make # make Install
Self-boost Mounting mode
# wget http://cdn.mysql.com/Downloads/MySQL-5.7/mysql-boost-5.7.10.tar.gz# tar-zxvf mysql-boost-5.7.10.tar.gz# CD mysql-5.7.10# cmake.-dcmake_install_prefix=/usr/local/mysql #-dwith_boost=/boost/boost_1_59_0 // Path to boost library #-DCURSES_LIBRARY=/PACKAGE/NCURESE/LIB/LIBNCURSES.A \ //ncurses Library libncurses.a#-dcurses_include_path =/package/ncurses/include //ncurses Library header file # make # make Install
Description: MySQL has been supported by the boost library since the 5.7 release. And it is very disgusting that MySQL needs to specify the boost version number, high or low, it is possible to cause the compilation does not pass.
To this, the use of CentOS7 on the most commonly used, the new Web module has been basically completed, the rest is to configure these software. Haha, in fact, the code is much, but the understanding is really quite simple, on those several commands. What do you think? Isn't that pretty simple.
Reprinted: Centos7 from zero compilation Nginx+php+mysql preface one