Compile the configure parameters and dependency packages of php-fpm in php5.4 and above in linux source code.

Source: Internet
Author: User
: This article mainly introduces the configure parameters and dependency packages of php-fpm for compiling PHP 5.4 and above in linux source code. if you are interested in php tutorials, refer to them. You often need to compile and install php on your own in linux. There are many configure parameters. sometimes you need to re-compile php when you do not pay attention to it. Therefore, sort out the commonly used configure commands as follows.

Step 1: install the dependency package:

yum -y install gcc make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel libaio

In practice, you may also need to install the mcrypt extension. (a typical error occurs: phpmyadmin reports an error and cannot load the mcrypt extension ).

To install the mcrypt extension, run the following command:

yum install libmcrypt-devel

Then run the following command:

yum install php-mcrypt

In this way, the mcrypt extension is successfully installed.

Step 2: install php:

cd /tmpwget http://cn2.php.net/get/php-5.5.10.tar.gz/from/cn2.php.net/mirrortar -zxvf mirrorcd ./php-5.5.10

Then run the following command:

./configure \--prefix=/usr/local/php5 \--with-config-file-path=/usr/local/php5/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 \--with-libdir=lib64 \--enable-pdo \--enable-fpm \--enable-mcrypt

The following error may be reported during compilation:

checking for known struct flock definition… configure: error: Don’t know how to define struct flock on this system, set –enable-opcache=no

Solution:

yum groupinstall "Development tools"

Finally, run the following commands:

makemake install

The above describes how to compile the configure parameters and dependency packages of php-fpm that come with PHP 5.4 and above in linux source code, including some content, and hope to help those who are interested in php tutorials.

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.