: 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.