One, the operating system
Install the system as a minimal server and add a development tool library for post-compilation purposes.
Here is basically the next step, the next step, no more nonsense.
The installation is complete, enter the system, turn on the network, shut down the firewall or open the appropriate Web port.
The following installation actions are performed by default in the/root directory.
Two,nginx installation
Download Pcre and zlib, the earth people know ...
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.32.tar.gz
TAR-ZXVF pcre-8.32.tar.gz
CD pcre-8.32
./configure
Make && make install
wget http://zlib.net/zlib-1.2.7.tar.gz
TAR-ZXVF zlib-1.2.7.tar.gz
CD zlib-1.2.7
./configure
Make && make install
Download the current stable version nginx-1.2.7
Cd
wget http://nginx.org/download/nginx-1.2.7.tar.gz
TAR-ZXVF nginx-1.2.7.tar.gz
CD nginx-1.2.7
./configure--prefix=/usr/local/nginx/--with-pcre=/root/pcre-8.32--with-zlib=/root/zlib-1.2.7
Make && make install
/usr/local/nginx/sbin/nginx
Start, open the browser test the Nginx bar.
Third, install the PHP environment
Download current stable version php-5.3.22
wget Http://www.php.net/get/php-5.3.22.tar.gz/from/cn1.php.net/mirror
TAR-ZXVF php-5.3.22.tar.gz
Before you start compiling, install some basic PHP packages, and install them directly with Yum.
Yum-y Install GD Curl curl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel MySQL Mysql-devel
Compile the PHP directory when you are ready.
CD php-5.3.22
./configure--prefix=/usr/local/php--enable-fastcgi--enable-fpm--enable-debug--with-gd--with-jpeg-dir-- With-png-dir--with-freetype-dir--enable-mbstring--with-curl--with-mysql=/usr/bin/mysql--with-mysqli=/usr/bin/ Mysql_config
Make && make install
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
You can start PHP when the installation is complete.
/usr/local/php/sbin/php-fpm
After running, the error is not prompted and the startup succeeds.
Four, associated Nginx and PHP
Open nginx Config file to find the following configuration
Vi/usr/local/nginx/conf/nginx.conf
# location ~ \.php$ {
# root HTML;
# Fastcgi_pass 127.0.0.1:9000;
# Fastcgi_index index.php;
# Fastcgi_param Script_filename/scripts$fastcgi_script_name;
# include Fastcgi_param;
# }
Remove the comments for this configuration and change the include Fastcgi_param to include fastcgi.conf
Save Restart Nginx
/usr/local/nginx/sbin/nginx-s Reload
The default Web directory is an HTML folder, and a new test file is created below
touch/usr/local/nginx/html/test.php
vi/usr/local/nginx/html/test.php
Write <?php phpinfo ();? >
Once saved, access the page in a browser, such as displaying the PHP configuration information, and you're done.
5, CentOS 6.5 system installation Configuration nginx-1.2.7+php-5.3.22 Environment