There is a new version of this tutorial available for Debian 9 (Stretch).

How to install PHP 7 as PHP-FPM & FastCGI for ISPConfig 3 on Debian 8 (Jessie)

The final version of PHP 7 is available for download on Github and the PHP mirrors now. PHP7 is the next generation of the PHP programming language, it is up to 2 times faster than PHP 5.6 and 14 times faster than PHP 5.0 according to the release notes. The new PHP version is not 100% compatible with PHP 5.x as some deprecated API's have been removed, so it is a good idea to start testing your web sites for compatibility with this new release. This can be done easily and without affecting all sites on your server by using the multi PHP version feature in ISPConfig 3. The PHP version can be selected in the ISPConfig 3 website settings for each site individually. This feature works with PHP-FPM and FastCGI. This tutorial shows how to build the new PHP 7 as a PHP-FPM and a FastCGI version on a Debian Jessie server. These PHP 7 builds include Zend OPcache.


1 Preliminary Note

I will install PHP 7 that is currently in Beta at the time of this writing. Please note that PHP-FPM can be used on both Apache and Nginx servers while FastCGI is available only for Apache servers.

With older PHP versions, PHP-FPM and FastCGI had been mutually exclusive so that an FPM and FastCGI binary had to be built separately. With PHP 7, a single binary that supports FPM and FCGI mode can be built.


2 Compile PHP 7 with PHP-FPM and Fastcgi

Download and extract PHP 7 from Github:

mkdir -p /opt/php-7.0.32
mkdir /usr/local/src/php7-build
cd /usr/local/src/php7-build
wget -O php-7.0.32.tar.bz2
tar jxf php-7.0.32.tar.bz2
cd php-7.0.32/

Install the prerequisites for building PHP 7 and the nano editor that I will use to edit the config files:

apt-get install build-essential nano
apt-get install libfcgi-dev libfcgi0ldbl libjpeg62-turbo-dbg libmcrypt-dev libssl-dev libc-client2007e libc-client2007e-dev libxml2-dev libbz2-dev libcurl4-openssl-dev libjpeg-dev libpng12-dev libfreetype6-dev libkrb5-dev libpq-dev libxml2-dev libxslt1-dev
ln -s /usr/lib/libc-client.a /usr/lib/x86_64-linux-gnu/libc-client.a

(The last command is needed if you build PHP with --with-imap, because otherwise ./configure will stop with the following error:

checking for crypt in -lcrypt... yes
configure: error: Cannot find imap library (libc-client.a). Please check your c-client installation.
[email protected]:/usr/local/src/php5-build/php-7.0.32#


Configure and build PHP 7.0.0 as follows (you can adjust the ./configure command to your needs, take a look at

./configure --help

to see all available options; if you use a different ./configure command, it is possible that additional libraries are required, or the build process will fail):

./configure --prefix=/opt/php-7.0.32 --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-pdo-mysql --with-mysqli --with-mysql-sock=/var/run/mysqld/mysqld.sock --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=/lib/x86_64-linux-gnu --enable-ftp --with-imap --with-imap-ssl --with-kerberos --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-fpm

The last switch (--enable-fpm) makes sure this PHP version will work with PHP-FPM.

make install

Copy php.ini and php-fpm.conf to the correct locations:

cp /usr/local/src/php7-build/php-7.0.32/php.ini-production /opt/php-7.0.32/lib/php.ini
cp /opt/php-7.0.32/etc/php-fpm.conf.default /opt/php-7.0.32/etc/php-fpm.conf
cp /opt/php-7.0.32/etc/php-fpm.d/www.conf.default /opt/php-7.0.32/etc/php-fpm.d/www.conf

Open /opt/php-7.0.32/etc/php-fpm.conf and adjust the following setting (remove the ; in front of the pid line):

nano /opt/php-7.0.32/etc/php-fpm.conf
pid = run/

Then open /opt/php-7.0.32/etc/php-fpm.d/www.conf and adjust the listen line, you must use an unused port (e.g. 8999; port 9000 might be in use by Debian's default PHP-FPM already):

nano /opt/php-7.0.32/etc/php-fpm.d/www.conf
listen =

3 Create the init script and systemd unit file

Debian supports Systemd as well as the traditional init scripts. First I will create an init script for the php-fpm service and then I will create a systemd unit.

First create an init script for PHP-FPM:

nano /etc/init.d/php-7.0.32-fpm
#! /bin/sh
# Provides:          php-7.0.32-fpm
# Required-Start:    $all
# Required-Stop:     $all
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts php-7.0.32-fpm
# Description:       starts the PHP FastCGI Process Manager daemon
php_opts="--fpm-config $php_fpm_CONF"
wait_for_pid () {
        while test $try -lt 35 ; do
                case "$1" in
                        if [ -f "$2" ] ; then
                        if [ ! -f "$2" ] ; then
                echo -n .
                try=`expr $try + 1`
                sleep 1
case "$1" in
                echo -n "Starting php-fpm "
                $php_fpm_BIN $php_opts
                if [ "$?" != 0 ] ; then
                        echo " failed"
                        exit 1
                wait_for_pid created $php_fpm_PID
                if [ -n "$try" ] ; then
                        echo " failed"
                        exit 1
                        echo " done"
                echo -n "Gracefully shutting down php-fpm "
                if [ ! -r $php_fpm_PID ] ; then
                        echo "warning, no pid file found - php-fpm is not running ?"
                        exit 1
                kill -QUIT `cat $php_fpm_PID`
                wait_for_pid removed $php_fpm_PID
                if [ -n "$try" ] ; then
                        echo " failed. Use force-exit"
                        exit 1
                        echo " done"
                       echo " done"
                echo -n "Terminating php-fpm "
                if [ ! -r $php_fpm_PID ] ; then
                        echo "warning, no pid file found - php-fpm is not running ?"
                        exit 1
                kill -TERM `cat $php_fpm_PID`
                wait_for_pid removed $php_fpm_PID
                if [ -n "$try" ] ; then
                        echo " failed"
                        exit 1
                        echo " done"
                $0 stop
                $0 start
                echo -n "Reload service php-fpm "
                if [ ! -r $php_fpm_PID ] ; then
                        echo "warning, no pid file found - php-fpm is not running ?"
                        exit 1
                kill -USR2 `cat $php_fpm_PID`
                echo " done"
                echo "Usage: $0 {start|stop|force-quit|restart|reload}"
                exit 1

Make the init script executable and create the system startup links:

chmod 755 /etc/init.d/php-7.0.32-fpm
insserv php-7.0.32-fpm

And now create the systemd unit file

nano /lib/systemd/system/php-7.0.32-fpm.service

with the follwoing content:

Description=The PHP 7 FastCGI Process Manager

ExecStart=/opt/php-7.0.32/sbin/php-fpm --nodaemonize --fpm-config /opt/php-7.0.32/etc/php-fpm.conf
ExecReload=/bin/kill -USR2 $MAINPID


Enable the service and reload systemd:

systemctl enable php-7.0.32-fpm.service
systemctl daemon-reload

Finally start PHP-FPM.

For systems with traditional init system, run:

/etc/init.d/php-7.0.32-fpm start

The result should be:

/etc/init.d/php-7.0.32-fpm start
Starting php-fpm done

On servers that use systemd, use this command instead:

systemctl start php-7.0.32-fpm.service

To enable the Zend OPcache, open /opt/php-7.0.32/lib/php.ini...

nano /opt/php-7.0.32/lib/php.ini

... and add the following line at the end:


The Memcache and APCu extension can not be installed on PHP 7 yet, so I will skip their installation for now. I will update the tutorial later when the pecl extensions are compatible with PHP 7.

Test the PHP version:

cd /opt/php-7.0.32/bin
./php --version

The output should be similar to this screenshot.

The PHP 7 final version on Debian 8.

Please note: The screenshot is from PHP 7.0.0, the tutorial gets updated continuously for new PHP 7 versions but we don't take new screenshots each time, so the PHP 7 version that you will see on your server is probably newer. The current version of this tutorial is for php-7.0.32.

4 Enable PHP 7 in ISPConfig

In ISPConfig 3, you can configure the new PHP version under System > Additional PHP Versions. On the Name tab, you just fill in a name for the PHP version (e.g. PHP 7.0.0) - this PHP version will be listed under this name in the website settings in ISPConfig:

Go to the FastCGI Settings tab and fill out the fields as follows:

Path to the PHP FastCGI binary: /opt/php-7.0.32/bin/php-cgi
Path to the php.ini directory: /opt/php-7.0.32/lib

Then g to the PHP-FPM Settings tab and fill out the fields as follows:

Path to the PHP-FPM init script: php-7.0.32-fpm
Path to the php.ini directory: /opt/php-7.0.32/lib
Path to the PHP-FPM pool directory: /opt/php-7.0.32/etc/php-fpm.d

Share this page:

86 Comment(s)

Add comment

Please register in our forum first to comment.


By: Ricardo

Your forgot:

systemctl enable php-7.0.0-fpm.service


By: till

Thanks, added it.

By: cristian

i followed all instructions and now i get in wordpress sites

Error establishing a database connection

By: till

The default MySQL socket path from Debian and MySQL differs. You can fix that with:

/bin/ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock

or use the updated configure statement from the tutorial and recompile php.

By: midian

And after this - u cant connect to your mariadb lol

By: till

You can connect to MariaDB by port, but not by socket. To connect by socket create a symlink for the socket:

/bin/ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock

or alternatively use the updated configure string from the tutorial which sets the Debian socket path.

By: gscaglia

Where is the "string from the tutorial which sets the Debian socket path" ib this tutorial?

By: till

This comment is about a older version of this tutorial and does not applyto the cirrent version. The string is:


./configure --prefix=/opt/php-7.0.5 --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-pdo-mysql --with-mysqli --with-mysql-sock=/var/run/mysqld/mysqld.sock --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=/lib/x86_64-linux-gnu --enable-ftp --with-imap --with-imap-ssl --with-kerberos --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-fpm


as shown in the tutorial.

By: merkur

This guide also works for Ubuntu 15.10 with the following changes:

- instead of libjpeg62-turbo-dbg I had to install libjpeg-turbo8-dbg

- to create the system startup links, instead of using insserv I ran 'update-rc.d php-7.0.0-fpm defaults'

And one tiny thing: comments in /opt/php-7.0.0/etc/php-fpm.conf are with ; instead of #

By: Denis

 error 502 nginx

By: till

Check the error.log of the website.

By: Denis

unix:/var/lib/php5-fpm/web.sock failed (2: No such file or directory)

By: lnxgs


you should disable "Use Socket For PHP-FPM" on options menu for your web domain. Swtiching from unix socket to tcp socket.




By: John

I can't install wordpress, joomla and drupal after i follow this and changed to PHP7 in ispconfig.  It seems permission I need to set. I couldn't figure it out.

By: till


/bin/ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock

to create a symlink for the MySQL socket.

By: insta-follow

Thank you for this post!

By: g-lo

Everythink works

Thank You :)

By: Denis

Now i have error 500 joomla.But wordpress work good

By: till

You can find details on the source of the error in the error.log of the website. Not all CMS support PHP 7 yet or they may need additional PHP modules.

By: Igor Almeida

This is what I get:

Error 500 and on the log file:

[fastcgi:error] [pid 27711] (2)No such file or directory: [client ip:54113] FastCGI: failed to connect to server "/var/www/clients/client7/web11/cgi-bin/php5-fcgi-ip-80-domain": connect() failed

By: Aisfrond


when enabling php-fpm apache looks for it on port 9010 and not on the port 8999 as mentioned above.

I'm still looking for a 'ispconfig' solution but in the meanwhile you can go to  /etc/apache2/sites-available and nano and change the port wherever you can.


Alternatively you can change the php7 port to 9010 and it works greatly but then you can't use php5xx (php-fpm) unless you change again the port.

Hope this helps!


By: till

You mix up port 8999 which is the instance for the www-data user with the insatnce created by ISPConfig for the website 9010. There is no need to edit any config files, just leave it as it is, you will see in phpmyadmin that the correct php version will show up in phpinfo after 60 seconds.

By: roman

nano /opt/php-7.0.0/lib/php.ini

set cgi.fix_pathinfo = 0

By: titi

Thanks for this! However I got a error 500 if I use php-FPM.

52] (104)Connection reset by peer: [client xxx:23480] FastCGI: comm with server "/var/www/clients/client0/web2/cgi-bin/php5-fcgi-xxxx" aborted: read failed


[Tue Dec 15 12:49:54.630691 2015] [fastcgi:error] [pid 4452] [client xxxx:23480] FastCGI: incomplete headers (0 bytes) received from server "/var/www/clients/client0/web2/cgi-bin/php5-fcgi-xxxx"


Why fast-cgi erros If I want to use php-FPM?

By: till

The apache module that does the connection to the php-fpm process is mod-fastcgi, that's why the error message contains the word fast-cgi. Most likely your php-fpm process is not started. If you need help with your setup, please us ethe forum.

By: titi

Ok so:


systemctl status php-7.0.0-fpm.service -l

I had:


ERROR: unable to bind listening socket for address '': Address already in use (98)

I changed to another port, like 8998. Restarted Apache. And it works now. thank!s

By: River Aras

Hello, i've done everything one by one but wordpress index page is not renderred. it loads the source of the php file instead of executing it.

<?php /** * Front to the WordPress application. This file doesn't do anything, but loads * wp-blog-header.php which does and tells WordPress to load the theme. * * @package WordPress */ /** * Tells WordPress to load the WordPress theme and output it. * * @var bool */ define('WP_USE_THEMES', true); /** Loads the WordPress Environment and Template */ require( dirname( __FILE__ ) . '/wp-blog-header.php' );

By: sucette


I tried to start php 7 and it's work on command line

etc/init.d/php-7.0.0-fpm startStarting php-fpm  done

./php --versionPHP 7.0.0 (cli) (built: Dec  6 2015 10:54:11) ( NTS )Copyright (c) 1997-2015 The PHP GroupZend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies


But when I select Php7-fpm from website configuration, php is not interpreted

By: till

ensure that you have mod_fastcgi (not to be mixed up with mod_fcgi) is installed on the server and enabled in apache.

By: sucette

Ok now i've got cgi/fastCGI but not php-fpm 

[pid 23603] [client ip:51456] FastCGI: incomplete headers (0 bytes) received from server "/var/www/clients/client1/web7/cgi-bin/php5-fcgi-*"

Php info show :

Server API CGI/FastCGI

When i do 


sudo lsof -U | grep php

i've got 

php-fpm   22927      root    5u  unix 0x0000000000000000      0t0 35385577 P35385578

php-fpm   22927      root    7u  unix 0x0000000000000000      0t0 35385578 P35385577


php-cgi   24388      web7    0u  unix 0x0000000000000000      0t0 35390367 /var/lib/apache2/fcgid/sock/24254.0

mod_fcgi is installed and enabled.

By: till

You have to enable mod_fastcgi AND mod_fcgi as described in the ISPConfig perfect server tutorial. Currently, you have only mod_fcgi enabled and therefore only php-fcgi works but not php-fpm which requires the mof_fasrtcgi module.

By: inside83

I have both and still get:

[Mon Jan 04 04:33:25.244931 2016] [fcgid:warn] [pid 26708] [client] mod_fcgid: stderr: PHP Fatal error:...

By: Bart


Did all parts of your tuto, good job.

php -v show me on php 5.6, with opCache ou zend cache on 7.0 (didn't remember which one exactly)

Is there any easy ways to check what was wrong or what isn't working?

By: Mohsen

Adding code mentioned in this tut and all I found on other tuts can't enable opcache!!! Php -v and opcache gui script say: opcache not enabled

By: till

Check the output of the phpinfo() command, if it shows opcache then it is enabled and your opcache detection script might have a failure or is not php7 compatible.

By: CreeWarrior

I had trouble with apt-get install libjpeg62-turbo-dbg i left it our and all the other packages installed. I noticed that 

The following extra packages will be installed:

  comerr-dev krb5-multidev libgcrypt11-dev libgnutls-dev libgnutlsxx27

  libgpg-error-dev libgssrpc4 libidn11-dev libjpeg-turbo8-dev libjpeg8-dev

  libkadm5clnt-mit9 libkadm5srv-mit9 libkdb5-7 libldap2-dev libp11-kit-dev

  libpam0g-dev librtmp-dev libssl-doc libtasn1-6-dev


I hope this will be alright to continue with libjpeg-turbo8-dev

By: Hans_Eimer

I use NGINX without ISPConfig! How to use php7/php-fpm on the whole System?

*.html files are accessible *.php files not... (i get a promt to download the php files)

cd /opt/php-7.0.0/bin => ./php --version: worksphp --version: not!

By: Ilko


so I installed everything as shown here and it is working perfectly. The only issue is that I could not get memcache, memcacged and the other extensions to work. I was having issues with ioncube as well. The problem is that I am running ispconfig3 on rasberiP with Arm processors, after long research I found that I have to use ioncube loader specifically for Rasberry Pi in order to get it working, but I was not able to find memcache and other for Rasberri Pi. Do you know, if such occur ?

The error I am getting is: Unable to load shared library file - I was getting same error for ioncube, but using the correct loader for Rasberry Pi fixed it. Now I am getting the same for all the other extensions described in the tutorial.

By: lnxgs


I followed the guide for PHP 7.0.1 and it works fine (I replaced every php-7.0.0 with php-7.0.1).

Tested with ispconfig 3 + Apache and ispconfig 3 + Nginx.




By: jnsc

If someone is interested, I also backported debian packages, but in order to not interfer with php5, you need to update to php5.6 before (I also backported this packages).

So this would only be for test environements.

By: Tom

Great tutorial, thanks a lot !

But actually I have this error /usr/bin/env: php: No such file or directory when trying to use composer. PHP 7 is correctly installed, indeed php -v shows what I expect.

PATH is not correctly configured, does not it; should symbolic link fix this ? (OS: debian 8)

By: Lars

I did this with php7.0.2 and it worked perfect!One question though, How do we update it? I am all new to not using apt-get.

By: till

The PHP is compiled manually, so you can not update this PHP version with apt-get. There are 2 options: Either you compile a new php version (e.g. 7.0.3) in a new folder and install it under a new name in ispconfig, then switch the sites to the new version, or you overwrite the old php version by compiling the new one in the same folder.

By: h4ni


I get this errors in error.log


2016/01/18 18:23:31 [error] 6011#0: *11 FastCGI sent in stderr: "PHP message: PHP Notice:  Undefined variable: data in /var/www/clients/client1/web1/web/includes/ on line 15

PHP message: PHP Notice:  Undefined variable: town_links in /var/www/clients/client1/web1/web/includes/ on line 13

PHP message: PHP Notice:  Undefined variable: ads_250 in /var/www/clients/client1/web1/web/includes/ads_250.php on line 2

PHP message: PHP Notice:  Undefined variable: search_widget in /var/www/clients/client1/web1/web/includes/ on line 7

PHP message: PHP Notice:  Undefined variable: ret in /var/www/clients/client1/web1/web/includes/ on line 7

PHP message: PHP Notice:  Undefined variable: footer_content in /var/www/clients/client1/web1/web/includes/ on line 4

By: till

These are warnings and not errors. They inform you about missing variable declarations in your php code.

By: Charles

I would like to enabel / install the intl libs, how do I go about it or do I have to reinstall ?

By: till

First you have to install libicu-dev:


apt-get install libicu-dev


then you can try to install it as module with pecl (I tried that yesterday at a client server but it did not work for me, did not had the time to investigate the issue in detail). I then just recompiled php with intl and that worked flawlessly.

By: ???

i found a error. correct locations:  cp /usr/local/src/php5-build/php-7.0.2/php.ini-production /opt/php-7.0.2/ect/php.ini     

By: till

The command in the tutorial that copys the file to lib is fine and not an error.

By: James

What is the fix on the socket for nginx/centos 7/mariadb?  Not sure why it is referencing php5 sock..? connect() to unix:/var/lib/php5-fpm/web5.sock failed (2: No such file or directory) while connecting to upstream, client: x.x.x.x, server:, request: "POST /wp-admin/setup-config.php?step=2 HTTP/1.1", upstream: "fastcgi://unix:/var/lib/php5-fpm/web5.sock:"

By: till

This tutorial is for Debian only, not CentOS. It is unlikely that this will work on CentOS without major modifications.

By: newtesla

Paths don't match, typo ;)"Then open /opt/php-7.0.2/etc/php-fpm.conf and ...

nano /opt/php-7.0.2/etc/php-fpm.d/www.conf

By: SpiGAndromeda


i installed php7 from official source before. php5 was removed automatically. php-fpm7.0 is running. But i get a 500 internal server error when trying to access ispconfig. Could you please help me?

By: till

Replacing the system PHP 5.x with PHP 7 will cause the system to fail as ispconfig 3.0.5.x expects a PHP version between 5.2 - 5.6 for its interface and server process. Please undo the PHP replacement that and then install an additional PHP 7 version as described here to get PHP 7 support.

By: MatiPasio

Thank you for this tutorial, but I have problem.

I can't start php-7.0.3-fpm.service (systemctl enable php-7.0.3-fpm.service), because I get this error:

update-rc.d: error: php-7.0.3-fpm Default-Start contains no runlevels, aborting.

Can you help? Thanks.

By: oliiix

Worked flawlessly!! Thank you so much :D

By: oliiix

ok something is actually not working. it doesn't interprete php.. do i have to add some line to apache2 config or add a php mod to the apache mods folder? or do i have to have php5 installed too? or do i have to manually specify a mime type for it? i'm really not very into such stuff and actually only want it up and running so i can move to webapp building... i think setting up cassandra is also going to be a challenge for me... i have no clue. fcgi and fastcgi are both enabled as also stated in the log file. i really followed every step except the ispconfig section as this looks like it needs working php the apache logfile content:

[email protected]:/etc/apache2# vim /var/log/apache2/error.log[Thu Mar 03 03:09:21.583385 2016] [:notice] [pid 1058:tid 140390004258688] FastCGI: process manager initialized (pid 1058)[Thu Mar 03 03:09:21.584409 2016] [mpm_event:notice] [pid 1055:tid 140390004258688] AH00489: Apache/2.4.10 (Debian) mod_fastcgi/mod_fastcgi-SNAP-0910052141 mod_fcgid/2.3.9 configured -- resuming normal operations[Thu Mar 03 03:09:21.584526 2016] [core:notice] [pid 1055:tid 140390004258688] AH00094: Command line: '/usr/sbin/apache2'

and the php-fpm log:

[email protected]:/etc/apache2# vim /opt/php-7.0.3/var/log/php-fpm.log[03-Mar-2016 03:25:11] NOTICE: fpm is running, pid 1440[03-Mar-2016 03:25:11] NOTICE: ready to handle connections~

By: till

The actual apache and nginx PHP setup is completely handled by ISPConfig (you can select php 7 in the website setings in fpm and fcgi mode) and yes, PHP5 is installed on an ISPConfig server as well (see perfect server tutorials) as this here is an additional PHP version that allows you to switch between php5 and php7 in the website in ISPConfig.

By: Hans

You should change the init script from

# Required-Start:    $all

# Required-Stop:     $all


# Required-Start:    $remote_fs $network

# Required-Stop:     $remote_fs $network


Otherwise you will end up in cyclic dependent services when installing more than one version according to this tutorial.


I can not send mails from PHP, something is missing?

By: razor7

As mentioned by @merkur comments, it worked for me on my Ubuntu Server 14.04 x64. I Also changed the PHP version to 7.0.4 editing the related commands shown above, very easy!

By: razor7

Hi! In this comment I want to ask if I can still use my "suPHP_ConfigPath" directives on my .htaccess files on domains seto to PHP-FPM. If no, is there a .htaccess config to force PHP-FPM to load custom user php.ini files?


By: suther

 Works like a charm with php 7.0.4 - for wheeze, only skip the systemctl stuff.

Thanks a lot for this nice Step by Step HowTo.

By: instagib

On debian 7, getting this error:


28.03.2016-13:57 - WARNING - Apache did not restart after the configuration change for website Reverting the configuration. Saved non-working config as /etc/apache2/sites-available/ 28.03.2016-13:57 - WARNING - Reason for Apache restart failure: Failed to get D-Bus connection: No connection to service manager.

By: Diego

Up and running on Ubuntu 14.04 server.

Thanks for what a very usefull info!

By: Franbk

Has anyone hints to add xdebug to this installation?

By: bernie

Any solution regarding memcached yet? Many thanks

By: Lucjan


On debian 8, getting Error 500 and on the log file:

[fastcgi:error] [pid 22406] (2)No such file or directory: [client xxx:26399] FastCGI: failed to connect to server "/var/www/clients/client1/web2/cgi-bin/php5-fcgi-*": connect() failed[fastcgi:error] [pid 22406] [client xxx:26399] FastCGI: incomplete headers (0 bytes) received from server "/var/www/clients/client1/web2/cgi-bin/php5-fcgi-*"

The previous answers did not help to solve the problem#systemctl status php-7.0.5-fpm.service -lshows:

php-7.0.5-fpm.service - The PHP 7 FastCGI Process Manager   Loaded: loaded (/lib/systemd/system/php-7.0.5-fpm.service; enabled)   Active: inactive (dead)Apr 24 01:19:07 isp systemd[1]: Unit php-7.0.5-fpm.service cannot be reloaded because it is inactive.

By: Chris

sudo apt-get install gcc make autoconf libc-dev pkg-configsudo apt-get install zlib1g-devsudo apt-get install libmemcached-devcd /usr/local/src/php5-buildgit clone php-memcachedgit checkout php7/opt/php-7.0.6/bin/phpizePATH=/opt/php-7.0.6/bin:$PATH ./configure --disable-memcached-saslmakesudo make install


==> This one doesnt worksudo bash -c "echo > /opt/php-7.0.6/lib/conf.d/memcached.ini"

==> I could it only get it to work when i add it at example: /var/www/conf/web1/php.ini

sudo service php-7.0.6-fpm restart================================================================================sudo apt-get install gcc make autoconf libc-dev pkg-configsudo apt-get install zlib1g-devsudo apt-get install libmemcached-devcd /usr/local/src/php5-buildgit clone

cd apcu

git checkout sevenmake cleanPATH=/opt/php-7.0.6/bin:$PATH ./configure make -j 4make installcd ..rm -rf ./apcu

==> and again, This one doesnt work# add extensionecho "" > /opt/php-7.0.6/lib/conf.d/ext-apcu.iniecho "apc.enable_cli = On" >> /opt/php-7.0.6/lib/conf.d/ext-apcu.ini

==> I could it only get it to work when i add it at example: /var/www/conf/web1/php.ini

i add


when i compiled php-7.0.6


./configure --prefix=/opt/php-7.0.6 --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-pdo-mysql --with-mysqli --with-mysql-sock=/var/run/mysqld/mysqld.sock --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=/lib/x86_64-linux-gnu --enable-ftp --with-imap --with-imap-ssl --with-kerberos --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-fpm --with-config-file-scan-dir=/opt/php-7.0.6/lib/conf.d

By: Dallas

For Magento 2 you need install

apt-get install libicu-dev

and configure with --enable-intl


By: Stefano

How can i remove php7.0.2 before install the new version?

By: agentmoller001
By: Esteban Marin


I found a easier alternative that is also nicer to update: Use the PPA

Here is how I successfully installed PHP7-FPM in parallel with PHP5.5-FPM on Ubuntu 14.04:


apt-get install software-properties-common

add-apt-repository ppa:ondrej/php

apt-get update

apt-get install php7.0-fpm

apt-get install php7.0-mysql

apt-get install php7.0-imap

apt-get install php7.0-mbstring php7.0-gd php7.0-zip

a2enmod proxy_fcgi

a2enconf php7.0-fpm

update-alternatives --set php /usr/bin/php5

Beware that enabling proxy_fcgi causes troubles with ISPConfig when using PHP-FPM over Unix-Sockets, since the configuration is buggy in that case. See You can also manually fix the file /usr/local/ispconfig/server/conf/vhost.conf.master

The last command changes the target of /usr/bin/php back to PHP5, the system default, which is recommended.

Apart from that, it is working well and enables to run PHP5 and PHP7 in FPM-Mode in parallel.

By: Amine

in case you got the error : configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing.

Then you need to install the Imap headers of the c-client library : 

apt-get install libc-client2007e-dev


By: vaio1

Hi guys! Thanks for the tutorial!

I have a strange behaviour when I try to start the new 7.0.7 FPM

# /etc/init.d/php-7.0.7-fpm start

Starting php-fpm [13-Jun-2016 12:25:02] ERROR: failed to open error_log (/opt/php-7.0.5/var/log/php-fpm.log): No such file or directory (2)

[13-Jun-2016 12:25:02] ERROR: failed to post process the configuration

[13-Jun-2016 12:25:02] ERROR: FPM initialization failed


It read the old version 7.0.5 but I have deleted that obsolete directory. What have I to do? How to fix it?


By: emmaluc

on step :

Copy php.ini and php-fpm.conf to the correct locations:

I've this message : (in french)

cp: impossible de créer le fichier standard « /opt/php-7.0.7/lib/php.ini »: Aucun fichier ou dossier de ce type

On thi step, i've the same message :(

nano /opt/php-7.0.7/etc/php-fpm.conf

By: Andrea

You forgot this too: (To make php executable from everywhere)

cp /opt/php-7.0.7/php /bin/

By: till

I did not forgot this, the php binary should not be copied to /bin. When you do that, then you replace the system PHP with this additional PHP version, this is not intended and will break ISPConfig.

By: orasis

Hello any information on how to make geoip work with PHP 7 would be aprpeciated. Maybe in the next tutorial update it would be very useful. Thanks a lot, very good tutorial as always.

By: Jesse Norell

The php-7.0.9 source from github (or does not include a `configure` script, to create it run `./buildconf --force` from within the php-7.0.9/ source directory.

By: Henri

Does this HOWTO work for Debian 7 as well?


By: SpeedyB

I need the intl plugin so I had to install libicu-dev and add --enable-intl to the configure

By: SpeedyB

But the plugin is not available in PHP. Anyone any idea?

By: joost

in order to get CakePHP up and running, I need to install the intl extention. Where and how can I include this in this workflow?

By: Jack

Hi, any working solution for adding memcached to this installation?

Or maybe any tutorial how to set lower 7.+ version of PHP with memcached support for IspConfig 3.1?

By: MultiTricker

I tried this tutorial with notes from merkur and it works perfect with PHP 7.1.8 and Ubuntu Server 14.04 LTS, thank you!