Linux source code compiled php5.4 above with PHP-FPM configure parameters and dependent packages

Source: Internet
Author: User
Tags flock mcrypt
Often use the Linux environment to compile their own installation php,configure parameters, and sometimes do not pay attention to the use of the time to recompile PHP, so the commonly used configure command collation as follows.

The first step is to install the dependent packages:

Yum-y install gcc make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel Libaio

It should be possible to install the MCrypt extension in practice (typical error: phpMyAdmin errors, unable to load MCrypt extensions).

To install the MCrypt extension, you can use the command:

Yum Install Libmcrypt-devel

Then use the command:

Yum Install Php-mcrypt

This will successfully install the MCrypt extension.

The second step is to 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 execute the 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 compilation process may have reported the following error:

Checking for known struct flock definition ... configure:error:Don ' t know how to define struct flock on the This system, set–e Nable-opcache=no

The workaround is to:

Yum Groupinstall "Development tools"

Finally, execute the command separately:

Makemake Install

The above describes the Linux source code compiled php5.4 above with php-fpm configure parameters and dependencies, including the contents of the content, I hope that the PHP tutorial interested in a friend helpful.

  • Related Article

    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.