Linux PHP compilation installation

Source: Internet
Author: User

1. Download the PHP installation package

Http://cn2.php.net/get/php-5.5.36.tar.gz/from/this/mirror

By default, Nginx and PHP have a little feeling between them. Apache+php compiled after the module file is generated, and nginx+php need PHP to generate executable files, so to use fastcgi technology to implement Nginx and PHP integration, this as long as we install the fastcgi can be enabled. This time we install PHP not only use the fastcgi, but also use php-fpm such a thing, PHP-FPM is a management fastcgi a manager, it as a plugin for PHP exists, In the installation of PHP to use PHP-FPM will need to PHP-FPM as a patch installed in PHP, and PHP to be consistent with the PHP-FPM version, it is necessary, remember!

2. Installation

[Email protected] src]#Tar-ZXVF php-5.5. $.Tar. gz [[email protected] src]# CD PHP-5.5. $[[email protected] PHP-5.5. $]#./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc--with-png-dir=/usr/local/libpng--with-jpeg-dir=/usr/local/jpeg--with-freetype-dir=/usr/local/freetype--with-zlib-dir=/usr/local/zlib--with-mcrypt=/usr/local/libmcrypt--with-libxml-dir=/usr/local/libxml2/--with-iconv-dir=/usr/local/libiconv--enable-libxml--enable-xml--enable-bcmath--enable-shmop--enable-sysvsem--enable-inl Ine-optimization--enable-opcache--enable-mbregex--enable-fpm--enable-mbstring=all--enable-gd-native-ttf- -with-openssl--enable-pcntl--enable-sockets--with-xmlrpc--enable-Zip--enable-soap--without-pear--with-gettext--enable-session--with-curl--enable-ctype--enable-shared--wi th-GD [[email protected] PHP-5.5. $] Makeclean[[email protected] PHP-5.5. $] Make[[email protected] PHP-5.5. $] Make Install

3. Copy the php.ini-development in the source code to the set php.ini search path.

[Email protected] php-5.5.  $ CP Php.ini-development/usr/local/php/etc/php.ini

4. Copy an PHP-FPM configuration file named php-fpm.conf (/usr/local/php/etc path)

CP Php-fpm.conf.default php-fpm.conf

5. Start PHP-FPM

[Email protected]/]#/usr/local/php/sbin/php-FPM [[email protected]/]#PSAux |grepphp-Fpmroot7790 0.0 0.2 27300 3048? Ss A: at 0:xxPhp-fpm:master Process (/usr/local/php/etc/php-fpm.conf) Nobody7791 0.0 0.4 27300 4380? S A: at 0:xxphp-Fpm:pool www Nobody7792 0.0 0.2 27300 2524? S A: at 0:xxphp-Fpm:pool www root8124 0.0 0.0 4420 756pts/3S+ at: + 0:xx grepphp-fpm

Report:

1. Find the PHP configuration file path

[Email protected]/]#/usr/local/php/bin/php--/usr/local/php/etcloaded Configuration File:         / usr/local/php/etc/for in: (none) Additional. ini files parsed:      (none)

2. Close PHP-FPM

Killall php-fpm

Linux PHP compilation installation

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.