Compiling PHP 5.6 on Fedora

Here's the dependencies and configuration I use to compile PHP 5.6 on Fedora.

First Download PHP 5.6 to `/usr/local/src` and extract it.

Next, install all the devel libraries required to configure and compile PHP:

dnf install  libxml2-devel openssl-devel bzip2-devel \
libcurl-devel libjpeg-turbo-devel libpng-devel gmp-devel  \
libmcrypt-devel libtidy-devel libxslt-devel

Now create a file named `configure.sh` in the PHP source directory and add the contents below:

./configure \
--prefix=/usr/local/php56 \
--with-config-file-path=/etc/php56 \
--with-config-file-scan-dir=/etc/php56/config.d \
--enable-dtrace \
--enable-bcmath \
--with-bz2 \
--enable-calendar \
--with-curl \
--enable-dba \
--enable-exif \
--enable-ftp \
--with-openssl \
--with-zlib \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--enable-mbstring \
--with-mcrypt \
--with-mysql \
--with-mysqli \
--enable-opcache \
--with-pdo-mysql \
--enable-shmop \
--enable-soap \
--enable-sockets \
--enable-sysvmsg \
--with-tidy \
--enable-wddx \
--with-xmlrpc \
--with-xsl \
--enable-zip \
--enable-mysqlnd \
--with-pear \
--with-gmp \
--enable-fpm \
--with-fpm-user=nginx \
--with-fpm-group=nginx

Make it executable:

chmod +x configure.sh

Now configure, build, and install:

./configure.sh
make
make install

Create config directory and files:

mkdir -p /etc/php56/conf.d
cp php.ini-development /etc/php56/php.ini