User Tools

Site Tools


plugins:phpswitcher:fcgid:php5.5

Howto Compile PHP 5.5.12

Introduction

This howto explain how to compile and install PHP5.5.12 on Debian, to be run as a FastCGI application (Fcgid). This howto also explain how to register this PHP version through the PhpSwitcher plugin. This howto is exactly the same as the 5.3.x howto from nuxwin. Only the Version 5.3.28 is replaced by 5.5.12.

Creating build environment

# cd /usr/local/src
# mkdir -p php_buildenv/php55 && cd php_buildenv/php55
# apt-get update && apt-get install build-essential

If you already compiled PHP5.2.x or PHP5.3.x

use this

# cd /usr/local/src/php_buildenv
# mkdir -p php55 && cd php55
# apt-get update && apt-get install build-essential

and skip the next 2 Steps.

Installing build dependencies

# apt-get build-dep php5
# apt-get install libfcgi-dev libfcgi0ldbl libjpeg62-dbg libmcrypt-dev \
libssl-dev libc-client2007e libc-client2007e-dev libpq5

Needed on X86_64 arch only

# ln -s /usr/lib/libc-client.a /usr/lib/x86_64-linux-gnu/libc-client.a

Fetching PHP sources

# wget http://de.php.net/get/php-5.5.12.tar.bz2/from/this/mirror -O php.tar.bz2
# tar xjf php.tar.bz2
# cd php-5.5.12

Configuration

The configuration options below are for the X86_64 architecture. option for the i386 architecture will be added later.

# ./configure \
--prefix=/opt/php-fcgid/5.5 \
--with-config-file-scan-dir=/opt/php-fcgid/5.5/conf.d \
--with-pdo-pgsql \
--with-zlib-dir \
--with-freetype-dir \
--enable-mbstring \
--with-libxml-dir=/usr \
--enable-soap \
--enable-calendar \
--with-curl \
--with-mcrypt \
--with-zlib \
--with-gd \
--with-pgsql \
--disable-rpath \
--enable-inline-optimization \
--with-bz2 \
--with-zlib \
--enable-sockets \
--enable-sysvsem \
--enable-sysvshm \
--enable-pcntl \
--enable-mbregex \
--enable-exif \
--enable-bcmath \
--with-mhash \
--enable-zip \
--with-pcre-regex \
--with-mysql=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-mysql-sock=/var/run/mysqld/mysqld.sock \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--enable-gd-native-ttf \
--with-openssl \
--with-libdir=/lib/x86_64-linux-gnu \
--enable-ftp \
--with-imap \
--with-imap-ssl \
--with-kerberos \
--with-gettext \
--with-xmlrpc \
--with-xsl \
--enable-cgi

Note: If you need more modules, you must tune the configuration options and install needed libraries.

Compilation and installation

# make
# make install

Checking

Test your php binary by running the following command:

# /opt/php-fcgid/5.5/bin/php-cgi -v

which should give a result such as:

PHP 5.5.12 (cgi-fcgi) (built: May 23 2014 16:19:42)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies

Registration through PhpSwitcher

  1. Login into the panel as administrator and go to the PhpSwitcher interface (settings section)
  2. Create a new PHP version with the following parameters:
ParameterValueDescription
NamePHP5.5 (Fcgid)This is the unique name for the new PHP version
PHP binary path/opt/php-fcgid/5.5/bin/php-cgiThis is the path of the PHP binary
PHP configuration directory/var/www/fcgiThis is the directory in which customers's PHP configuration files are stored

Once it's done and if all goes well, your customers should be able to switch to this new PHP version using their own PhpSwitcher interface, which is available in the Domains section.

Troubleshootings

If you are running MariaDB on your server and if you encounter some problems while trying to install PHP build packages, you must temporary switch to the MySQL version as provided by your distribution. This can be done easily by using the i-MSCP installer.

The tips about MariaDB above is not a viable solution. A better solution will be show later.

/var/www/virtual/i-mscp.net/wiki/htdocs/data/pages/plugins/phpswitcher/fcgid/php5.5.txt · Last modified: 2014/05/27 03:03 by fisa4