Compile php-fpm in Ubuntu to configure the php environment

Source: Internet
Author: User

First go to the http://php-fpm.org/downloads/ to download the php-5.2.10-fpm-0.5.13.diff.gz, and then download the php source code php-5.2.10.tar.bz2

Then run the following command:

The code is as follows: Copy code
Tar jxf php-5.2.10.tar.bz2
Cd php-5.2.10
Gunzip-c ../php-5.2.10-fpm-0.5.13.diff.gz | patch-p1
Apt-get install build-essential libxml2-dev libmcrypt-dev libssl-dev libldap2-dev libmhash-dev libmysqlclient15-dev libcurl4-openssl-dev libpng12-dev libjpeg-dev libsasl2-dev
. /Configure -- prefix =/opt/php -- with-iconv -- with-zlib -- enable-xml -- disable-rpath -- enable-discard-path -- enable-safe-mode -- enable- bcmath -- enable-shmop -- enable-sysvsem -- enable-inline-optimization -- with-curl -- with-curlwrappers -- enable-mbregex -- enable-fastcgi -- enable-fpm -- enable-force- cgi-redirect -- enable-mbstring -- with-mcrypt -- with-gd -- enable-gd-native-ttf -- with-openssl -- with-mhash -- enable-pcntl -- enable-sockets -- with-ldap -- with-ldap-sasl -- with-xmlrpc -- enable-zip -- enable-soap -- without-pear -- with-mysql -- with-mysqli -- enable-sqlite-utf8 -- with-pdo- mysql -- enable-ftp -- with-jpeg-dir -- with-freetype-dir
-- With-png-dir
Make
Make install
Cp php. ini-dist/opt/php/lib/php. ini
Ln-s/opt/php/sbin/php-fpm/etc/init. d/php-fpm
Update-rc.d-f php-fpm defaults
/Etc/init. d/php-fpm start

The compiled php is installed under/opt/php. The php configuration file is

The code is as follows: Copy code
/Opt/php/lib/php. ini

Then run

The code is as follows: Copy code
/Etc/init. d/php-fpm start

You can start the fastcgi process of php. These php fastcgi processes should work properly.

Optimize php-fpm
Edit the configuration file/opt/php/etc/php-fpm.conf for php-fpm,

Remove the comments of display_errors and change the parameter value to 1.
Comment remove the comment of the sendmail_path parameter
Comment Remove user and group parameter comments
Modify the value of max_children to 50

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.