Comments on How To Use Multiple PHP Versions (PHP-FPM & FastCGI) With ISPConfig 3 (Ubuntu 12.04 LTS)

How To Use Multiple PHP Versions (PHP-FPM & FastCGI) With ISPConfig 3 (Ubuntu 12.04 LTS) Since ISPConfig 3.0.5, it is possible to use multiple PHP versions on one server and select the optimal PHP version for a website. This feature works with PHP-FPM (starting with PHP 5.3) and FastCGI (all PHP 5.x versions). This tutorial shows how to build PHP 5.3 and PHP 5.4 as a PHP-FPM and a FastCGI version on an Ubuntu 12.04 server. These PHP versions can be used together with the default PHP (installed through apt) in ISPConfig.

14 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: junkri

On debian 6(squeeze), you shoud use --with-libdir=/lib64 instead of --with-libdir=/lib/x86_64-linux-gnu
 
without that, you'll get the error of imap library mentioned above.

By: suther

For i386/i686 system you have to remove the parameter: --with-libdir=/lib/x86_64-linux-gnu.

 Otherwise, you got the imap-error described for x64 system above!

By: junkri

if the php_fpm can't handle the new versions of php, make sure that you enabled fastcgi:

apt-get install libapache2-mod-fastcgi
a2enmod fastcgi
/etc/init.d/apache2 restart

By: Anonymous

#2

I GET TO: ln -s /usr/lib/libc-client.a /usr/lib/x86_64-linux-gnu/libc-client.a

 ln: failed to create symbolic link `/usr/lib/x86_64-linux-gnu/libc-client.a': No such file or directory

ANY HELP????

By: Pavel

Is possible add to this tutorial php version 5.2.x? For example 5.2.6, or 5.2.17. Probably this is version, what is required for old joomla 1.5.x.

 Thanks

By: Anonymous

I get to 

 cp /opt/php-5.3.22/etc/php-fpm.conf.default /opt/php-5.3.22/etc/php-fpm.conf 

 and i get cp:cannot stat `/opt/php-5.3.22/etc/php-fpm.conf.default': no such file or directory

 Can someone please explain me why i get it and how to fix it?

By: iNeard

Only for x64!
To correct the libc-client-Error:

ln -s /usr/lib/libc-client.a /usr/lib64/


To correct the libmysqlclient-Error:

ln -s /usr/lib/libmysqlclient.a /usr/lib64/


After that, the ./configure-Command:

..
--with-libdir=/lib64
..

thx

By:

I have installed Ubuntu 12.04 LTS and ISPconfig 3 the last stable on 32-bit pc

1st error

When I put command

 

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

 

I get result: No such file or directory

2nd error

When I put command

cp /usr/local/src/php5-build/php-5.3.22/php.ini-production /opt/php-5.3.22/lib/php.ini

 

I get result: No such file or directory
Directory lib doesn't exist

can somebody resolve this problems?
Thanks

By: Anonymous

i get an error using:

wget http://de.php.net/get/php-5.3.22.tar.bz2/from/this/mirror -O php-5.3.22.tar.bz2

returns:

Connecting to de.php.net (de.php.net)|212.124.37.9|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2014-10-14 04:33:34 ERROR 404: Not Found.

Was the download location changed? Anyone else experienced this issue?

Any updated links to download older php versions properly?

 

Thanks in advanced!

By: johnymas

Hello.

On Ubuntu 14.04, after the fix for "libc-client.a", you also have to do the following :

ln -s /usr/include/freetype2 /usr/include/freetype2/freetype

Otherwise ./configure will failed with a "freetype.h not found" error.

by Cédric.

By: ezero

If someone still having problems with configuring I would recommend making this change. I did it on my ubuntu 14.10 server.

Go to /usr/ directory

 

[code]cd /usr/[/code]

 

Now create a symlink to lib directory called lib64

[code]ln -s /usr/lib lib64[/code]

 

Now configure using 

 

[code]

./configure \

--prefix=/opt/php-5.3.22 \

--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 \

--with-mhash \

--enable-zip \

--with-pcre-regex \

--with-mysql \

--with-pdo-mysql \

--with-mysqli \

--with-jpeg-dir=/usr \

--with-png-dir=/usr \

--enable-gd-native-ttf \

--with-openssl \

--with-fpm-user=www-data \

--with-fpm-group=www-data \

--with-libdir=/lib64 \

--enable-ftp \

--with-imap \

--with-imap-ssl \

--with-openssl  \

--with-kerberos \

--with-gettext \

--enable-fpm

 

[/code]

By: Tony Medina

Saludos, excelente aporte, adicionalemente agrego que tuve diversos inconvenientes para instalar la version 5.2.17 de php, la cual es un muy antigua. Al final, logre instalarla; a continuación el resumen de lo que realicé:

1) Antes de compilar se debe parchar con el siguiente archivo (contiene script para hacer patch) y los siguientes comandos: 

Archivo: https://mail.gnome.org/archives/xml/2012-August/txtbgxGXAvz4N.txt , este script lo puede guardar en la ruta donde descomprimió php, por ejemplo /usr/local/src/php5-build/php-5.2.17/php-5.2.17.patch

Comandos a ejecutar dentro de la ruta /usr/local/src/php5-build/: 

#patch -p1 ext/dom/node.c < php-5.2.17.patch

#patch -p1 ext/dom/documenttype.c < php-5.2.17.patch 

#patch -p1 ext/simplexml/simplexml.c < php-5.2.17.patch 

 

Esto soluciona cosas como el siguiente error al momento de hacer #make: 

 error: dereferencing pointer to incomplete typeRETVAL_STRINGL ((char *) buf-> Buffer-> content, ret, 1);^/usr/local/php52/Zend/zend_API.h:472:14: note: in macro definition of 'ZVAL_STRINGL'char * __ s = (s); int __l = l; \^/usr/local/php52/ext/dom/node.c:1955:5: note: in expansion of macro 'RETVAL_STRINGL'RETVAL_STRINGL ((char *) buf-> Buffer-> content, ret, 1);^make: *** [ext / dom / node.lo] Error 1

(Sacado de https://www.centos.org/forums/viewtopic.php?f=47&t=53046)

2) Quitar las opciones de compilacion no soportadas tales como (bueno esto es de aucerdo a tu servidor):

 --with-freetype-dir \

--with-imap \

 

--with-imap-ssl 

3) Debe ser compilado bajo con la opcion --enable-fastcgi y no con enable-cgi ya que esta version de php no soporta compilar con cgi. 

(Sacado de http://stackoverflow.com/questions/12153518/connection-reset-by-peer-mod-fcgid-error-reading-data-from-fastcgi-server)

By: mutaz

hi, thanks for sharing this great guide,

 

before proceeding in make, i have to setup the --prefix=/pot/php-5.4.12 to install the files in that directory, but the only directories created are, bin/ include/ lib/ and php/ .. but etc/ directory!!? is there a way to make it right?

By: Alex

is there any howto to install together php 5.6 and php 7.X?!?

Thank you very much!