PHP Source Compilation installation Configuration
http://php.net/downloads.php
CentOS under pre-installed dependencies, specific self-corresponding add general conditions below enough
Yum install gcc make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel-y
PHP Common Configuration Add
./configure--prefix=/usr/local/php \
--with-config-file-path=/usr/local/php/etc--with-bz2--with-curl \
--enable-ftp--enable-sockets--disable-ipv6--with-gd \
--with-jpeg-dir=/usr/local--with-png-dir=/usr/local \
--with-freetype-dir=/usr/local--enable-gd-native-ttf \
--with-iconv-dir=/usr/local--enable-mbstring--enable-calendar \
--with-gettext--with-libxml-dir=/usr/local--with-zlib \
--with-pdo-mysql=mysqlnd--with-mysqli=mysqlnd--with-mysql=mysqlnd \
--enable-dom--enable-xml--enable-fpm--with-libdir=lib64--enable-bcmath
At last
Make&&make Install
Copy php config file and fpm config file The FPM default port is 9000 Nginx proxy php fastcgi module via this port
CP Php.ini-production/usr/local/php/etc/php.ini
Cp/usr/local/php/etc/php-fpm.conf.default/usr/local/php-5.5.0/etc/php-fpm.conf
Finally, add the following section to the server segment under Nginx.conf to connect the PHP fast CGI
Location ~. *\. (PHP)? $
{
Expires-1s;
Try_files $uri = 404;
Fastcgi_split_path_info ^ (. +\.php) (/.+) $;
Include Fastcgi_params;
Fastcgi_param path_info $fastcgi _path_info;
Fastcgi_index index.php;
Fastcgi_param script_filename $document _root$fastcgi_script_name;
Fastcgi_pass 127.0.0.1:9000;
}
Test syntax is correct
Nginx-t
Boot PHP-FPM After starting in the Sbin directory of the PHP installation path
Ps-ef| grep fpm can view information on PHP-FPM
Start Nginx, at this time Nginx has been connected to the FASTCGI service provided by PHP-FPM.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Simple collation of PHP source code compilation and installation