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

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

The final version of PHP 7.1 is available for download on Github and the PHP mirrors now. PHP 7.1 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.1 as a PHP-FPM and a FastCGI version on a Debian Jessie server. This PHP 7.1 build includes many compiled in extensions and Zend OPcache and Memcached as loadable modules.


1 Preliminary Note

I will install PHP 7.1 which has been released as final version a few days ago. 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 build separately. With PHP 7.1, a single binary that supports FPM and FCGI mode can be build.


2 Compile PHP 7.1 with PHP-FPM and Fastcgi

Download and extract PHP 7.1 from Github:

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

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

apt-get install build-essential nano autoconf
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.7#


Configure and build PHP 7.1 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.1 --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.1.16/php.ini-production /opt/php-7.1/lib/php.ini
cp /opt/php-7.1/etc/php-fpm.conf.default /opt/php-7.1/etc/php-fpm.conf
cp /opt/php-7.1/etc/php-fpm.d/www.conf.default /opt/php-7.1/etc/php-fpm.d/www.conf

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

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

Then open /opt/php-7.1/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.1/etc/php-fpm.d/www.conf
listen =

When you use multiple additional PHP versions, then ensure to use a free port, e.g. 8998, 8997 and so on for the next versions.

3 Create the init script and systemd unit file

Debian supports Systemd as well as the traditional init scripts. Most systems today use Systemd, in this case proceed with chapter 3.2, for systems with traditional init system, follow chapter 3.1 and then proceed with chapter 4. Do not install both, the systemd and init.d script, on the same system.

3.1 Create a init.d start script

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.1-fpm
#! /bin/sh
# Provides:          php-7.1-fpm
# Required-Start:    $all
# Required-Stop:     $all
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts php-7.1-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.1-fpm
insserv php-7.1-fpm

Finally start PHP-FPM:

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

The result should be:

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

3.2 Create  Systemd script for PHP 7.1

Now create the systemd unit file:

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

with the following content:

Description=The PHP 7.1 FastCGI Process Manager

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


Enable the service and reload systemd:

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

Finally start PHP-FPM:

systemctl start php-7.1-fpm.service

4 Enable Zend OPcache

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

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

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


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

Test the PHP version:

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

The output should be similar to this screenshot.

PHP 7.1.16

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

5 Enable Memcache (optional)

In this chapter, I will compile and enable the PHP Memcached extension.

The first step is to install the libmemcached-dev package from Debian.

apt-get install libmemcached-dev

Then create a diretory, download the PHP memcache extension from Github, unpack the archive and enter the directory that contains the unpacked files.

mkdir /usr/local/src/php7-build/php-memcache
cd /usr/local/src/php7-build/php-memcache
cd php-memcached-php7

Prepare he sources by running the phpize command from PHP 7.1.


Configure and build the PHP memcache extension.

./configure --with-php-config=/opt/php-7.1/bin/php-config
make install

To enable the Memcache extension, open /opt/php-7.1/lib/php.ini...

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

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


2.1 Install xDebug extension (optional)

The xDebug module is a debugging extension for PHP. The installation is optional.

Install xDebug with these commands.

cd /opt/php-7.1/etc
pecl -C ./pear.conf update-channels
pecl -C ./pear.conf install xdebug

Then edit the php.ini file with an editor:

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

and add the following line at the end of the file:


Finally restart the php-fpm daemon:

service php-7.1-fpm restart

7 Enable PHP 7.1 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.1) - this PHP version will be listed under this name in the website settings in ISPConfig:

Enter the name of the custom PHP version

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

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

PHP 7.1 FastCGI

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

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

PHP 7.1 FPM settings

Share this page:

71 Comment(s)

Add comment

Please register in our forum first to comment.


By: Alaska

Hello,First off, I love ISPConfig :)I followed the tuto for the perfect debian jessie server, I don't think this is a huge problem since the step was optional but thought I would mention, tried using this tuto to add php 7 and got this error when installing memcache:


[email protected]:/usr/local/src/php7-build/php-memcache/php-memcached-php7# /opt/php-7.1/bin/phpize

Configuring for:

PHP Api Version:         20160303

Zend Module Api No:      20160303

Zend Extension Api No:   320160303

[email protected]:/usr/local/src/php7-build/php-memcache/php-memcached-php7# ./configure --with-php-config=/opt/php-7.1/bin/php-config

checking for grep that handles long lines and -e... /bin/grep

checking for egrep... /bin/grep -E

checking for a sed that does not truncate output... /bin/sed

checking for cc... cc

checking whether the C compiler works... yes

checking for C compiler default output file name... a.out

checking for suffix of executables...

checking whether we are cross compiling... no

checking for suffix of object files... o

checking whether we are using the GNU C compiler... yes

checking whether cc accepts -g... yes

checking for cc option to accept ISO C89... none needed

checking how to run the C preprocessor... cc -E

checking for icc... no

checking for suncc... no

checking whether cc understands -c and -o together... yes

checking for system library directory... lib

checking if compiler supports -R... no

checking if compiler supports -Wl,-rpath,... yes

checking build system type... x86_64-unknown-linux-gnu

checking host system type... x86_64-unknown-linux-gnu

checking target system type... x86_64-unknown-linux-gnu

checking for PHP prefix... /opt/php-7.1

checking for PHP includes... -I/opt/php-7.1/include/php -I/opt/php-7.1/include/php/main -I/opt/php-7.1/include/php/TSRM -I/opt/php-7.1/include/php/Zend -I/opt/php-7.1/include/php/ext -I/opt/php-7.1/include/php/ext/date/lib

checking for PHP extension directory... /opt/php-7.1/lib/php/extensions/no-debug-non-zts-20160303

checking for PHP installed headers prefix... /opt/php-7.1/include/php

checking if debug is enabled... no

checking if zts is enabled... no

checking for re2c... re2c

checking for re2c version... 0.13.5 (ok)

checking for gawk... no

checking for nawk... nawk

checking if nawk is broken... no

checking whether to enable memcached support... yes, shared

checking for libmemcached... yes, shared

checking whether to enable memcached session handler support... yes

checking whether to enable memcached igbinary serializer support... no

checking whether to enable memcached json serializer support... no

checking whether to enable memcached msgpack serializer support... no

checking whether to enable memcached sasl support... yes

checking whether to enable memcached protocol support... no

checking whether to use system FastLZ bibrary... no

checking for ZLIB... yes, shared

checking for pkg-config... no

pkg-config not found

configure: error: Please reinstall the pkg-config distribution

[email protected]:/usr/local/src/php7-build/php-memcache/php-memcached-php7# make

make: *** No targets specified and no makefile found.  Stop.


By: till

Maybe you missed installing the build-essential package?



apt-get install build-essential


if this won't help, then install the missing package manually with:


apt-get install pkg-config

By: Cli69

Indeed !

apt-get install pkg-config


By: Lenny

I can't pass through step 2 (Debian 8.6, sources.list - main contrib non-free)

E: Unable to locate package libc-client2007e-dev libxml2-dev libbz2-dev libcurl4-openssl-dev libjpeg-dev libpng12-dev libfreetype6-dev libkrb5-dev libpq-devE: Unable to locate package libxml2-dev libxslt1-dev

Thanks for help

By: till

The packages are available here on my Debian 8.6. The sources.list is:


deb jessie main contrib non-freedeb-src jessie main contrib non-free

deb jessie/updates main contrib non-freedeb-src jessie/updates main contrib non-free

By: rene

Enable Memcache (optional)

gives me the follwing error on Debian 8.6

checking for pkg-config... no

pkg-config not found

configure: error: Please reinstall the pkg-config distribution

By: till

See posts above.

By: thctlo

Hai, to get the build dependecy fixed, and easy fix/try is. add the sid source line to the sources.list. deb-src sid main contrib non-free

run apt-get update

run : apt-get build-dep php7.0 i dont think the depencies changed much here. Packages that didnt install due to version mismatch, install these manually. now compile php7.1


By: thctlo

Till, i forgot to ask. If i setup on debian jessie and i create debian packages for php7(.1)( like the debdot versions php7.0 ) Can we still mix php5.6 with php7.x on debian jessie even with only debian packages installed? im asking this because only create debian packages and install with apt.

Source/compiling software is not allowed on my servers, so its a bit more difficult sometimes to setup.


By: Alfio Saitta

Please, add the intl extension

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 libicu-dev

 ./configure --prefix=/opt/php-7.1 --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 --enable-intl

By: M1r

for php_intl error:configure: error: Unable to detect ICU prefix or no failed. Please verify ICU install prefix and make sure icu-config works.


apt-get install libicu-dev

By: Johnymas


I got an error on ubuntu lts 16.04

E: Unable to locate package libjpeg62-turbo-dbg

Any suggestion?

By: till

This tutorial is for Debian 8 only, not Ubuntu. The pacjage names on Ubuntu are different.

By: Johnymas

Ok, thanks.

Till, is there any tutorial to install PHP 7.1 as PHP-FPM & FastCGI for ISPConfig 3.1 on ubuntu lts 16.04?

By: V-II

so i've updated and installed 7.1 - appears to be going good..

biggest question...

what about updates?

another package i use is 

they utilize a script to update the /opt/php7 - /opt/php5.6 - /opt/php/7.1 folders when a new version is released


When an updated 7.1 version is released do we need to remove the service so we can continue to use the port?

would be good to upate the existing links and use a master location that is updated when a version is updated. 


Client picks 7.0 / 7.1 / 5.6 - updates happen under them...


haven't seen how ISPCP would update vs just installing a new one and manually changing sites then deleting and backing out every change - eventually using up a crazy amount of listen ports!?! if not removed manually?

By: till

Compile the new version into the same folder and restart php-fpm. Or you use folders for the sub versions like /opt/php/7.1.0, /opt/php/7.1.1 etc. and create a symlink /opt/php/7.1 that points to the recent version and then alter that symlink when you compiled a new version. The ports have not to be altered when you replace a version.


Btw. the above applies to the control panel ISPConfig and not ISPCP.

By: Sunny

@til to Update for further Question (i could directly comment to that):

i tested your suggestion and create /opt/php/7.1/ with symlink to /opt/php/7.1.0 where i installed all like this tutorial says, thanks for that. it seems to work fine, but i got a mail from ispconfig with "WARNING - Action aborted, file is a symlink: /opt/php/7.1/lib/php.ini" so how to work with that and what does it mean at all, because the website works and shows working php 7.1 ?! thx

By: Ralf Behrendt

Please add the save command after editing the files. Maybe some beginner is not sure if he should do it or not. Because in any other case you can copy & past, but how to save nano is not mentioned.

By the way on debian 8 adn ispconfig 3 the turorial works perfect for me.

By: Thomas

If you go with the systemd script option, what is the path that you set in the "Path to the PHP-FPM init script" setting in ISPConfig?

By: till

Just set it as if you would have added a init script, ispconfig detects that systemd is installed and uses a systemd unit with the name of the init script. S just do it as shown in the tutorial, the settings will work for init.d and systemd.

By: Thomas

Thanks a lot for your response! The thing is that the path will be non-existent. Do I have to create the init.d script in /etc/init.d/php-7.1-fpm and just rely on the fact that ISPConfig will not use it if systemd is installed or just point to the non-existent location? The reason that I'm asking is that if I leave this line empty, the new version does not show up in my users' websites.

By: till

Just do what the tutorial tells you to do in step 6 on your server. If you would have to do something different, then the tutorial would have told you. It does not matter if this path exists or not.

By: onastvar

ISPConfig 3.1 does not SAVE the following entries. I have to click on CANCEL to get out of the screen.

Path to the PHP-FPM init script: /etc/init.d/php-7.1-fpmPath to the php.ini directory: /opt/php-7.1/libPath to the PHP-FPM pool directory: /opt/php-7.1/etc/php-fpm.d

By: till

Just tested it here, the paths save fine. I guess you might have copied a whitespace or something like that and not just the path.

By: fbarcenas

Any IONCUBE for this yet??

By: Andreas


i am very unexperiencend with linux an tried to follow these instructions. But after "make" and "make install" i can´t go one because the path /opt/php-7.1 is empty. What´s wrong?I use Debian 8 on bananapi

Thanks for help


By: krishna

same issue

By: DonMcCoy

If you are on Debian 8 by now, install through the repo it's available now, don't go through the compiling hassle, when you compile it you can upgraded it in future or your can't add new components unless you recompile everything, but when you simply install it from a repo it's so flexible to upgrade, delete and add new componenets.

By: Maycon Brito

Thank you! This was the first time that I instaled PHP from source with successfull. I put this page in my favorites.

I've installed  with debian:latest docker image and now I'm developing the Docker file from this tutorial.

By: Markus

Hi, i installed the server with this tutorial

and when I try to start /etc/init.d/php-7.1-fpm i get the following error:


[email protected]:/usr/local/src/php7-build/php-7.1.0# /etc/init.d/php-7.1-fpm start

Starting php-fpm [11-Jan-2017 18:53:49] ALERT: [pool www] the process manager is missing (static, dynamic or ondemand)

[11-Jan-2017 18:53:49] ERROR: failed to post process the configuration

[11-Jan-2017 18:53:49] ERROR: FPM initialization failed


Can you help me?

By: Christoforos Korifidis

I follow the instruction but there are not any etc/fpm* files. Instead these files are under the directory sapi/. Can I use these files?


By: Max Devaine

Configuration is very strange. You have some files in "/opt", some files in "/usr/share", you have configuration in "/opt/php-7.1/lib". This does not make sense. Why does not use dir options? For example :

./configure --prefix=/opt/php/7.1.1 \--bindir=/opt/php/7.1.1/bin \--sbindir=/opt/php/7.1.1/sbin \--libexecdir=/opt/php/7.1.1/lib \--datadir=/opt/php/7.1.1/share \--sysconfdir=/opt/php/7.1.1/etc \--sharedstatedir=/php/7.1.1/com \--localstatedir=/opt/php/7.1.1/var \--libdir=/opt/php/7.1.1/lib/x86_64-linux-gnu \--includedir=/opt/php/7.1.1/include \--infodir=/opt/php/7.1.1/share/info \--mandir=/opt/php/7.1.1/share/man \--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

By: abce

Wow, Thanks.

I want a install php 5 near php7 in ispconfig on server decieded, How i can do it?

By: Jango

if you have problem compile error: cc: Internal error: Killed (program cc1)

just add this in configure: --disable-fileinfo

By: Mat

thanks for this great guide works perfect!

i have added it to my imscp ;-)

is for php7.1 also redis & apcu / apcu bc extensions available?

I cannot find the github to install it similar to memcache above


thx in advance 

By: Hirbod

It is possible to install APCU.

cd /tmpgit clone apcu/opt/php-7.1/bin/phpize./configure --with-php-config=/opt/php-7.1/bin/php-configmakeexport TEST_PHP_ARGS='-n'make testmake installnano /opt/php-7.1/lib/php.ini (put at the end of file)Content:extension=apcu.soapc.enabled=1apc.shm_size=32Mapc.ttl=7200apc.enable_cli=1 

By: Porompompero

Hi guys. I followed the tutorial. Fast-cgi works like a charm, but FPM doesn't work. I test with the classical "<?php phpinfo(); ?>", but my browser show the same code (no interpreting): "<?php phpinfo(); ?>"

Can you help me, please? Thanks.

By: helios

hi, how fixed thie error please? thx


pkg-config est déjà la plus récente version disponible.

0 mis à jour, 0 nouvellement installés, 0 à enlever et 0 non mis à jour.

[email protected]:/usr/local/src/php7-build/php-memcache/php-memcached-php7# /opt/php-7.1/bin/phpize

Configuring for:

PHP Api Version:         20160303

Zend Module Api No:      20160303

Zend Extension Api No:   320160303

Cannot find autoconf. Please check your autoconf installation and the

$PHP_AUTOCONF environment variable. Then, rerun this script.


[email protected]:/usr/local/src/php7-build/php-memcache/php-memcached-php7#

By: Hbod

PHP 7.1 has "WebP" support, please also add this into the Howto. apt-get install webp libwebp-devAnd add --with-webp-dir=/usrto the configure line!

By: SimonGilli

Hi Till

Thanks for that great guide, everthing worked fine as expected!

But I really don't like to compile and install software by myself, I love debian packages ;-)

So I searched for an other way last week and I have found the PHP package maintainers site at for Debian and Ubuntu packages. I followed the instructions at and installed versions 7.0 and 7.1 by apt-get (the default packages from debian were already installed before). Then I added the following PHP configs to IPSConfig and everything works fine so far:

PHP 5.6 (default packages by Debian):

PHP FastCGI Binary: php5-cgiphp.ini: /etc/php5/cgi/php.ini

PHP-FPM Init Script: php5-fpmphp.ini: /etc/php5/fpm/php.iniPHP-FPM Pool: /etc/php5/fpm/pool.d

PHP 7.0:

PHP FastCGI Binary: php-cgi7.0php.ini: /etc/php/7.0/cgi/php.ini

PHP-FPM Init Script: php-fpm7.0php.ini: /etc/php/7.0/fpm/php.iniPHP-FPM Pool: /etc/php/7.0/fpm/pool.d

PHP 7.1:

PHP FastCGI Binary: php-cgi7.1php.ini: /etc/php/7.1/cgi/php.ini

PHP-FPM Init Script: php-fpm7.1php.ini: /etc/php/7.1/fpm/php.iniPHP-FPM Pool: /etc/php/7.1/fpm/pool.d

I only tested Fast-CGI for the moment, it's possible that the FPM ports needs to be addaped to get FPM working. I will test that a.s.a.p.

I think the links in /etc/alternatives are pointing always to the highest version of PHP, so I had to add the 5.6 config because Default in ISPConfig points to 7.1 after that procedure and not longer to 5.6.

If you like this alternative procedure for installing PHP on Debian and Ubuntu, I will write an article for howtoforge after my tests are finished.

What do you think?


By: till

Hi Simon,

thank you for posting the instructions. It would be great if you could write a tutorial about that for howtoforge.



By: SimonGilli

Hi Till,

I made some progress in my investigations, but one question on your tutorial is resting:

Why do you use an IP connection in /opt/php-7.1/etc/php-fpm.d/www.conf and not use the default socket connection? Is there a special reason for that? I think the socket connection is more lightweight than an IP connection and IP is only necessary for distributed installs where FPM runs on an other server.


By: Chris

When I install this, it keeps throwing me the following error:

/etc/init.d/php-7.1-fpm startStarting php-fpm [07-Apr-2017 10:30:59] ERROR: No pool defined. at least one pool section must be specified in config file[07-Apr-2017 10:30:59] ERROR: failed to post process the configuration[07-Apr-2017 10:30:59] ERROR: FPM initialization failed failed

Any ideas?

By: cipito

Does this work for CENTOS 7?

I need to add PHP 7 on my server.

I could not find any tutorial with Centos.

Thank you

By: LA


Thank you very much for this tutorial. I had followed every step. I have no error during installation and process.

But now when I chose PHP-FPM mode in Ispconfig with addionnal PHP version 7.1, I see the php source on the website. When I do the same thing chosing Fast-CGI mode with php 7.1 it run...

Do you have an idea ? 

thank you?

By: vikozo


quiet at the beginnig i have a problem

# 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-devPaketlisten werden gelesen... FertigAbhängigkeitsbaum wird aufgebaut.Statusinformationen werden eingelesen.... Fertiglibc-client2007e ist schon die neueste Version.libc-client2007e wurde als manuell installiert festgelegt.Einige Pakete konnten nicht installiert werden. Das kann bedeuten, dassSie eine unmögliche Situation angefordert haben oder, wenn Sie dieUnstable-Distribution verwenden, dass einige erforderliche Pakete nochnicht erstellt wurden oder Incoming noch nicht verlassen haben.Die folgenden Informationen helfen Ihnen vielleicht, die Situation zu lösen:Die folgenden Pakete haben unerfüllte Abhängigkeiten: libc-client2007e-dev : Hängt ab von: comerr-dev soll aber nicht installiert werden                        Hängt ab von: krb5-multidev soll aber nicht installiert werden libkrb5-dev : Hängt ab von: krb5-multidev (= 1.12.1+dfsg-19+deb8u2) soll aber nicht installiert werden libpq-dev : Hängt ab von: krb5-multidev soll aber nicht installiert werden             Hängt ab von: comerr-dev soll aber nicht installiert werden libssl-dev : Hängt ab von: libssl1.0.0 (= 1.0.1t-1+deb8u6) aber 1.0.2k-1~bpo8+1 soll installiert werden              Empfiehlt: libssl-doc soll aber nicht installiert werdenE: Probleme können nicht korrigiert werden, Sie haben zurückgehaltene defekte Pakete.

By: Dahero

I'm wondering whats wrong with my install. Alternate PHP 7.1 shows up, I set it for the first site, and it goes 503. The error.log and the vhost conf file references to php5-fpm.

[Wed May 10 17:25:23.110960 2017] [proxy:error] [pid 24326] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /var/lib/php5-fpm/web1.sock (*) failed

[Wed May 10 17:25:23.137629 2017] [proxy_fcgi:error] [pid 24326] [client] AH01079: failed to make connection to backend: httpd-UDS

I just upgraded ISPConfig3 to git-stable with no luck. Any idea other than hardcoding all the conf files?

By: Aloa

Hi,I use this tutorial on Ubintu 12.04 with nginx. Everything work fantastic and correct like other Till's tutorials. Thank you!Now i need to install intl. I try:cd /opt/php-7.1/etcpecl -C ./pear.conf update-channelspecl -C ./pear.conf install intland get this error: ERROR: `/tmp/pear/temp/intl/configure --with-icu-dir=DEFAULT' failedi read some info and go to: apt-get install libicu-devNow i have new error:In file included from /tmp/pear/temp/intl/php_intl.h:34:0,                 from /tmp/pear/temp/intl/php_intl.c:25:/tmp/pear/temp/intl/intl_error.h:24:40: fatal error: ext/standard/php_smart_str.h: No such file or directory #include <ext/standard/php_smart_str.h>                                        ^compilation terminated.make: *** [php_intl.lo] Error 1ERROR: `make' failed Can anyone help me whit this error ?

By: oir91

I have the same problem installing pecl and I don't find information about this. Could anyone help with this error?

By: pix3l

The installation worked on my system without any error. But when I create an info.php I get an ERROR 500 Internal Server error. But nothing is shown in the error/logfiles. There is also no php7-fpm error logfile in /var/log.

I also checked the rights and they seem to be correct as well (644 owned by webXY)

Any idea?

By: Rafael Santana


I got an error in instalation

[email protected]:/usr/local/src/php7-build/php-7.1.2# cp /usr/local/src/php7-build/php-7.1.2/php.ini-production /opt/php-7.1/lib/php.ini

cp: cannot create regular file '/opt/php-7.1/lib/php.ini': No such file or directory

[email protected]:/usr/local/src/php7-build/php-7.1.2# cp /opt/php-7.1/etc/php-fpm.conf.default /opt/php-7.1/etc/php-fpm.conf

cp: cannot stat '/opt/php-7.1/etc/php-fpm.conf.default': No such file or directory

[email protected]:/usr/local/src/php7-build/php-7.1.2# cp /opt/php-7.1/etc/php-fpm.d/www.conf.default /opt/php-7.1/etc/php-fpm.d/www.conf

cp: cannot stat '/opt/php-7.1/etc/php-fpm.d/www.conf.default': No such file or directory


By: Joel

Error during install process:

[email protected]:~ $ sudo cp /opt/php-7.1/etc/php-fpm.conf.default /opt/php-7.1/etc/php-fpm.conf

cp: cannot stat ‘/opt/php-7.1/etc/php-fpm.conf.default’: No such file or directory


By: till

Either the compilation with the make command failed or the make install failed on your system. Check make output for errors.

By: Yang Ke

I have the same problem. Please help.

By: Roland Barkoczi

Thank you for sharing this tutorial. My system built on Debian 7. Will this tutorial work on it?

By: Lukas Vlek

Hellou, please help me. Installing php 7 is complete ok, in isp config added new php version. When I change the version of the website, the php version will remain unchanged. Why ? In apache vhost config file is link to php5-fcgi ... i dont know ... Thanks for help.

By: hsluis

Hello Till, please update to 7.1.7 version, this is a security release.

By: fx

 i'm noob and french :-( and i've succeeded at the 1er attempt. Thanks for this excellent tutoriel !

By: Eveny

Resolv problem with OpenSSL configureapt-get install pkg-config

By: azu

Thanks for this tutorial.

May I use it for install PHP 7.1x  To a server with debian 9,isp config, php7?

Or it is possible to replace PHP7 with PHP7.1.X and add future update in sources list?

By: quaz22


Debian 8.9 - clean installation according to (The Perfect Server - Debian 8.4 Jessie (Apache2, BIND, Dovecot, ISPConfig 3.1))


I did everything according to instructions but PHP 7.1.10 FPM not working.

ERROR 500 - Internal Server Error!


PHP 7.1.10 Fast-CGI is working.


By: quaz22

I do not know why but somehow it worked

After restart the server still did not work

I gave the command

/etc/init.d/php-7.1-fpm stop

service apache2 restart

Once again, even though I did it before

  chmod 755 /etc/init.d/php-7.1-fpm

  insserv php-7.1-fpm

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

/etc/init.d/php-7.1-fpm stop

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

service apache2 restart

and it worked

Restart the Apache may need to enable it

Great big thanks for the tutorial

Good job


By: Florent

This tutorial is excellent, work like a charm!

By: halycon

I installed php7.1 as additional php version. now i need ldap extension. in php5 i can install the extension simply by using apt-get. How to install extensions with this compiled version?

Thanks :)

By: nazih ridwan

I get an error:

virtual memory exhausted: Cannot allocate memory

By: webguyz

Install swap file on your OS so it uses disk space for virtual memory

By: Muneeb

Hello everyo,

Everything installed fine, however i needed to use php-fpm 7.1 with nginx, and i followed this tutorial here: to install nginx.

in thins, its mentioned to add php config in nginx.conf file, and there is this line:

                fastcgi_pass unix:/var/run/php-fpm.sock;

i wonder what is path of php-fpm.sock ? may be i'm missing something, i don't know. Please Help.

Best regards,

By: Andrei Coman

The config it works with intl and ldap for moodle I used is:

After you need to do this.

For intl

apt-get install libicu-dev

For ldap

apt-get install libldb-dev libldap2-dev

./configure --prefix=/opt/php-7.1 --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 --enable-intl --with-ldap

By: Paul

Hi! I got error after 'make':

Generating phar.phar                                                                                                                                              Warning: Unknown: Unable to find the wrapper "php" - did you forget to enable it  when you configured PHP? in Unknown on line 0                                                                                                                    Warning: Unknown: Unable to find the wrapper "php" - did you forget to enable it  when you configured PHP? in Unknown on line 0                                                                                                                    Warning: Unknown: Unable to find the wrapper "php" - did you forget to enable it  when you configured PHP? in Unknown on line 0                                                                                                                    Parse error: syntax error, unexpected 'error' (T_STRING) in /usr/local/src/php7- build/php-7.1.1/ext/phar/phar.php on line 26

Makefile:464: recipe for target 'ext/phar/phar.phar' failed

make: *** [ext/phar/phar.phar] Error 255

I can't find any answer...

By: valentin1000

/opt/php-7.1/etc# pecl -C ./pear.conf install xdebugpecl/xdebug requires PHP (version >= 7.0.0), installed version is 5.6.38-0+deb8u1No valid packages foundinstall failed

Any help please...

By: Laszlo Csurulya

Thank you.