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.