Simple compilation of PHP source code compiling installation

Source: Internet
Author: User
Tags fpm php source code
PHP source code Compilation installation Configuration
Download Address
http://php.net/downloads.php


CentOS under preloaded dependencies, specific to their 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 configuration file and FPM profile 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 section under Nginx.conf to connect 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


Start PHP-FPM after starting in the Sbin directory of the PHP installation path
Ps-ef| grep fpm can view information about the PHP-FPM


Start Nginx, at which point Nginx is already connected to the FASTCGI service provided by PHP-FPM.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.