Comments on How to install PHP 7.1, 7.2 and 5.6 as PHP-FPM & FastCGI for ISPConfig 3 on Debian 9

This tutorial shows how to build PHP 7.1, PHP 7.2, and PHP 5.6 as PHP-FPM and FastCGI version on Debian 9 (Stretch) that uses the ISPConfig 3 Hosting Control Panel.

114 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Johannes

Hallo Till,

welchen Vorteil soll das selber-compilieren haben gegenüber der apt Methode, die auch automatisch updated?

Beste Grüße,

Johannes

--

echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/sury.list apt install apt-transport-https curl https://packages.sury.org/php/apt.gpg | apt-key add - apt update apt install php7.0 apt install php7.1   etc ...

By: till

The above guide should show how to compile alternate PHP versions. You are free to use PHP packages from sury.org if you prefer that of course and I might cover that in another tutorial as well.

By: johnymas

Hi Till,what are the differences between installation guides for debian and ubuntu?

By: till

The one is for Ubuntu and the other one for Debian :) The installation instructions for Debian and Ubuntu are quite similar as the Distributions are similar, but nonetheless, they differ a bit.

By: Raphaël

Hello, Till,

I have follow the guide above on a Debian Stretch 9.3 and get those errors after the "make" command for php5.6

/usr/bin/ld: warning: libssl.so.1.1, needed by /usr/lib/x86_64-linux-gnu/libpq.so, may conflict with libssl.so.1.0.0/usr/bin/ld: warning: libssl.so.1.1, needed by /usr/lib/x86_64-linux-gnu/libpq.so, may conflict with libssl.so.1.0.0/usr/bin/ld: warning: libssl.so.1.1, needed by /usr/lib/x86_64-linux-gnu/libpq.so, may conflict with libssl.so.1.0.0/usr/bin/ld: warning: libssl.so.1.1, needed by /usr/lib/x86_64-linux-gnu/libpq.so, may conflict with libssl.so.1.0.0/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libc-client.a(osdep.o): undefined reference to symbol 'TLS_server_method@@OPENSSL_1_1_0'//usr/lib/x86_64-linux-gnu/libssl.so.1.1: error adding symbols: DSO missing from command linecollect2: error: ld returned 1 exit statusMakefile:273 : la recette pour la cible « sapi/cli/php » a échouéemake: *** [sapi/cli/php] Erreur 1

and i also had this warnings for libssl.so and libcrypt.so for php7.1 & php7.2

/usr/lib/x86_64-linux-gnu/libc-client.a(osdep.o): In function `ssl_onceonlyinit.part.7':(.text+0x5d7e): warning: the use of `tmpnam' is dangerous, better use `mkstemp'/usr/bin/ld: warning: libssl.so.1.0.2, needed by /usr/lib/x86_64-linux-gnu/libcurl.so, may conflict with libssl.so.1.1/usr/bin/ld: warning: libssl.so.1.0.2, needed by /usr/lib/x86_64-linux-gnu/libcurl.so, may conflict with libssl.so.1.1/usr/bin/ld: warning: libssl.so.1.0.2, needed by /usr/lib/x86_64-linux-gnu/libcurl.so, may conflict with libssl.so.1.1/usr/bin/ld: warning: libssl.so.1.0.2, needed by /usr/lib/x86_64-linux-gnu/libcurl.so, may conflict with libssl.so.1.1/usr/bin/ld: warning: libcrypto.so.1.0.2, needed by /usr/lib/x86_64-linux-gnu/libcurl.so, may conflict with libcrypto.so.1.1/usr/bin/ld: warning: libcrypto.so.1.0.2, needed by /usr/lib/x86_64-linux-gnu/libcurl.so, may conflict with libcrypto.so.1.1/usr/bin/ld: warning: libcrypto.so.1.0.2, needed by /usr/lib/x86_64-linux-gnu/libcurl.so, may conflict with libcrypto.so.1.1/usr/bin/ld: warning: libcrypto.so.1.0.2, needed by /usr/lib/x86_64-linux-gnu/libcurl.so, may conflict with libcrypto.so.1.1/usr/bin/ld: warning: libcrypto.so.1.0.2, needed by /usr/lib/x86_64-linux-gnu/libcurl.so, may conflict with libcrypto.so.1.1/usr/bin/ld: warning: libcrypto.so.1.0.2, needed by /usr/lib/x86_64-linux-gnu/libcurl.so, may conflict with libcrypto.so.1.1/usr/bin/ld: warning: libcrypto.so.1.0.2, needed by /usr/lib/x86_64-linux-gnu/libcurl.so, may conflict with libcrypto.so.1.1/usr/bin/ld: warning: libcrypto.so.1.0.2, needed by /usr/lib/x86_64-linux-gnu/libcurl.so, may conflict with libcrypto.so.1.1Generating phar.phpGenerating phar.pharPEAR package PHP_Archive not installed: generated phar will require PHP's phar extension be enabled.directorytreeiterator.incclicommand.incpharcommand.incinvertedregexiterator.incdirectorygraphiterator.incphar.incBuild complete.Don't forget to run 'make test'.

Do you have a idea ?

Thanks and best regards.

Raphaël

By: till

These are just warnings and not errors. Try to test the compiled PHP, it should work.

By: rmathez

Sorry, for PHP 7.1 & 7.2 it was only Warning and the make test have returns some erros but not realy relevant and the compiling/installation are successful.

But for PHP 5.6 i have the following error and i can't do a "make test" or a "make install". It give me the same error again.

/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libc-client.a(osdep.o): undefined reference to symbol 'TLS_server_method@@OPENSSL_1_1_0'//usr/lib/x86_64-linux-gnu/libssl.so.1.1: error adding symbols: DSO missing from command linecollect2: error: ld returned 1 exit statusMakefile:273 : la recette pour la cible « sapi/cli/php » a échouée make: *** [sapi/cli/php] Error 1

 

By: till

Ok. I'll check that part of the tutorial again. Maybe something changed since I've written that guide.

By: PatFoo

had the same error as rmathez on php 5 install:

/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libc-client.a(osdep.o): undefined reference to symbol 'TLS_server_method@@OPENSSL_1_1_0'//usr/lib/x86_64-linux-gnu/libssl.so.1.1: error adding symbols: DSO missing from command linecollect2: error: ld returned 1 exit statusMakefile:273: recipe for target 'sapi/cli/php' failedmake: *** [sapi/cli/php] Error 1

thank you again for ispconfig

By: bruma

Hi

got same error when compiling php 5.6

 -lxml2 -lxml2 -lxslt -lxml2 -lcrypt  -o sapi/cli/php/usr/lib/x86_64-linux-gnu/libc-client.a(osdep.o): In function `ssl_onceonlyinit.part.7':(.text+0x5d7e): warning: the use of `tmpnam' is dangerous, better use `mkstemp'/usr/bin/ld: warning: libssl.so.1.1, needed by /usr/lib/x86_64-linux-gnu/libpq.so, may conflict with libssl.so.1.0.0/usr/bin/ld: warning: libssl.so.1.1, needed by /usr/lib/x86_64-linux-gnu/libpq.so, may conflict with libssl.so.1.0.0/usr/bin/ld: warning: libssl.so.1.1, needed by /usr/lib/x86_64-linux-gnu/libpq.so, may conflict with libssl.so.1.0.0/usr/bin/ld: warning: libssl.so.1.1, needed by /usr/lib/x86_64-linux-gnu/libpq.so, may conflict with libssl.so.1.0.0/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libc-client.a(osdep.o): undefined reference to symbol 'TLS_server_method@@OPENSSL_1_1_0'//usr/lib/x86_64-linux-gnu/libssl.so.1.1: error adding symbols: DSO missing from command linecollect2: error: ld returned 1 exit statusMakefile:273: recipe for target 'sapi/cli/php' failedmake: *** [sapi/cli/php] Error 1

By: till

Like I posted above, I'll check that part again to see what has changed. No need to repost the same issue.

By: Petik

Hi bruma,

check compile without --with-imap and --with-imap-ssl, if it is possible. Without imap it works.

Petik

By: bruma

Without --with-imap and --with-imap-ssl it compiles, but don't now how will that affect on apps that need ssl support?

By: till

I've removed the IMAP flags for now in the tutorial. It's indeed the IMAP part that causes the issue. IMAP is not used by that many apps, so it should be fine to remove it. If one would want to have IMAP support, then an older version of UW-IMAP lib needs to be compiled and linked into PHP and most likely an older version of the Kerberos lib as well.

By: DylanPedro

any ideas why this issues is there with php 5.6 as have has the same issues?

By: Haxley

I also have the mistake

/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libc-client.a(osdep.o): undefined reference to symbol 'TLS_server_method@@OPENSSL_1_1_0' //usr/lib/x86_64-linux-gnu/libssl.so.1.1: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status Makefile:273: recipe for target 'sapi/cli/php' failed make: *** [sapi/cli/php] Error 1place Help

By: Haxley

ok its work

ist this ok? php 7.1 listen =127.0.0.1:8999

and

PHP 5.6 listen =127.0.0.1:8999?

identical Port?

By: till

No, it has to be a unique free port. Change that to e.g. 8997 when you install all 3 PHP versions. I've updated that in the tutorials as well.

By: bruma

I think this line is wong, this is dir does not exist?

include=/opt/php-5.6.30/etc/php-fpm.d/*.conf

By: till

Change it to include=/opt/php-5.6/etc/php-fpm.d/*.conf

By: Olli2k

 2 questions from my side:

1. 5.6 is not working.

Mär 19 10:33:54 host systemd[1]: Started The PHP 5.6 FastCGI Process Manager.Mär 19 10:33:54 host php-fpm[8125]: [19-Mar-2018 10:33:54] ERROR: Unable to globalize '/opt/php-5.6/etc/php-fpm.d/*.conf' (ret=2) from /opt/php-5.6/etc/php-fpm.conf at line 16.Mär 19 10:33:54 host php-fpm[8125]: [19-Mar-2018 10:33:54] ERROR: failed to load configuration file '/opt/php-5.6/etc/php-fpm.conf'Mär 19 10:33:54 host php-fpm[8125]: [19-Mar-2018 10:33:54] ERROR: FPM initialization failedMär 19 10:33:54 host systemd[1]: php-5.6-fpm.service: Main process exited, code=exited, status=78/n/aMär 19 10:33:54 host systemd[1]: php-5.6-fpm.service: Unit entered failed state.Mär 19 10:33:54 host systemd[1]: php-5.6-fpm.service: Failed with result 'exit-code'.

There is no directory called /php-fpm.d in /opt/php-5.6/etc. So what to do?

 

2. If I want to change to apt tutorial via sury.org, is it enogh to stop daemon and delete /lib/systemd/system/php-x.x-fpm.service files? Or what else do I need to do for uninstall?

By: stef157

Still not working.

I've to comment the line and then it's working…

By: Evil

PHP 5.6 ./configure .... --with-mysql otherwise (old) MYSQL support is missing! And this support is one of the main reasons to install/compile old PHP do Debian9.

By: Haxley

Fast CGI 7.0(default), 7.1, 7.2, 5.6 it work

PHP- FPM 5.6 not work.

if a switch tto fpm and select 5.6. send Apache a 7.0 !Error:

[proxy:error] [pid 6813] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /var/lib/php7.0-fpm/web2.sock (*) failed

if change to PHP FPM 7.2!send phpinfo () : PHP Version 7.0.27-0deb9u1

 

By: Petik

I had the same problem. Check the /opt/php-5.6/etc/php-fpm.d directory if it exists. And view log files.

By: bruma

Hi,

I compile and setup version 5.6.33 (and also 5.4.45). When I select version 5.6 (or 5.4) for site in ispconfig, ispconfig generates apache mysite.com.vhost file with content

FastCgiExternalServer /var/www/clients/client1/web1/cgi-bin/php5-fcgi-10.0.0.4-443-mysite.com -idle-timeout 300 -socket /var/lib/php7.0-fpm/web1.sock -pass-header Authorization  -pass-header Content-Type

SetHandler "proxy:unix:/var/lib/php7.0-fpm/web1.sock|fcgi://localhost"

so it references /var/lib/php7.0-fpm/web1.sock which is not ok because in apache log I get error

[proxy:error] [pid 24496] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /var/lib/php7.0-fpm/web1.sock (*) failed

Is ther a way to remove or repalce php7.0-fpm lines?

By: till

The socket path is absolutely fine. php7.0-fpm is not related to the PHP version at all, its the exact same path for any PHP version you use as that's the default directory of your OS for PHP sockets, regardless which version or custom PHP you use. Your problem is something different, definitely not the socket path. probably the compiled PHP is not working or you made a mistake while editing one of the PHP 5.6config files.

By: bruma

I recompile, now it's workig.

Thanks

By: helios842000

I can't compile php 5.6

Configuring extensions

checking size of long... (cached) 8

checking size of int... (cached) 4

checking for int32_t... yes

checking for uint32_t... yes

checking for sys/types.h... (cached) yes

checking for inttypes.h... (cached) yes

checking for stdint.h... (cached) yes

checking for string.h... (cached) yes

checking for stdlib.h... (cached) yes

checking for strtoll... yes

checking for atoll... yes

checking for strftime... (cached) yes

checking which regex library to use... php

checking whether to enable LIBXML support... yes

checking libxml2 install dir... /usr

checking for xml2-config path...

configure: error: xml2-config not found. Please check your libxml2 installation.

root@sd-47904:/usr/local/src/php5.6-build/php-5.6.33# make

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

 

By: helios842000

even after the March 2nd update, I still have the error message when compiling php5.6. and this command is missing:

mkdir /usr/include/freetype2

By: babydunk

Thanks a million Till ;)

everything went as smooth as butter apart from one typo  in 7.1 section

 

cp /usr/local/src/php7.1-build/php-7.1/php.ini-production /opt/php-7.1/lib/php.ini

 

Should be

 

cp /usr/local/src/php7.1-build/php-7.1.14/php.ini-production /opt/php-7.1/lib/php.ini

 

Thanks again Till

By: John

Hello Till,

Thanks for the guide. I followed this guide, and it all went well. Except that, in my installed ISPConfig (3.1.8p1) the "Let's Encrypt" option (and the SSL checkbox) don't seem to work. At least not with "version 5.6" of PHP. I can turn these options on, but after saving, they get turned off again by ISPConfig (after a while). So no certificate is generated for my site. Do I need some additional manual configuration...? Thanks for answering.

By: till

Let's encrypt and PHP is not related to each other. If you have issues with LE, please take a look at the FAQ in the forum and if that does not help you to solve the issue, then make a post in the forum. https://www.howtoforge.com/community/threads/lets-encrypt-error-faq.74179/

By: Tom

Hi Till, thank you for your work. Is it ok to follow this tutorial with Debian 8 and ISPC 3.1.11 ?

By: till

I guess it might work. You should use chapter 2 (installation of prerequisites) from the last Debian 8 guide https://www.howtoforge.com/tutorial/how-to-install-php-7.1-on-debian-8-jessie/ and then start with chapter 3 from this tutorial.

By: Steven

Hello,

i followed your tutorial, and everything works with compiling.. But if i have a website with php 5.6.(35) i am getting an error on the unixsocket under ngnix:[crit] 7047#7047: *161 connect() to unix:/var/lib/php7.0-fpm/web1.sock failed (2: No such file or directory) while connecting to upstream

If i change the fastcgi_pass from the unixsocket to: 127.0.0.1:8956 where the PHP-FPM runs, it works. so how i have to change the confs, that its not getting overriden by ispconfig?

 

greets

Steven

By: till

There must be a different problem then as there is no need to edit any config files and the fastcgi_pass should not point to the port you configured in php-fpm.conf of the compiled PHPas that would run all scripts under a wrong user. You can use the ISPConfig debug mode to find out why your setup fails and post in the forum if you need additional help.

By: Bernhard

Wget can easily save the downloaded files with the most apropriate name:

wget --content-disposition http://some.url.com/file.tar.gz

By: nmazza

Hello Till,

I have move my CentOS servers to Debian 9 server over ISPConfig 3.1.11

in Php 5.6 version, configure command, says ERROR and STOP.

checking for pkg-config... /usr/bin/pkg-configconfigure: error: Cannot find OpenSSL's librariesroot@mail:/usr/local/src/php5.6-build/php-5.6.33#

Any idea?

Thanks

Nestor Mazza

By: ashorlivs

I have successfully added PHP 7.2.2 FPM to my original "Perfect Server - Ubuntu 16.04 (Xenial Xerus)" system.

Thank you for this tutorial.

By: Iztok

Jessie + php5.6.** worked great. Stretch + php7.** has a lot of bugs. I tried to install php5.6.33 on new instalation of Debian9 Stretch and failed. Installation stoped here:

Configuring extensionschecking size of long... (cached) 8checking size of int... (cached) 4checking for int32_t... yeschecking for uint32_t... yeschecking for sys/types.h... (cached) yeschecking for inttypes.h... (cached) yeschecking for stdint.h... (cached) yeschecking for string.h... (cached) yeschecking for stdlib.h... (cached) yeschecking for strtoll... yeschecking for atoll... yeschecking for strftime... (cached) yeschecking which regex library to use... phpchecking whether to enable LIBXML support... yeschecking libxml2 install dir... /usrchecking for xml2-config path...configure: error: xml2-config not found. Please check your libxml2 installation.

I insalled as you described in

The Perfect Server - Debian 9 (Stretch) with Apache, BIND, Dovecot, PureFTPD and ISPConfig 3.1

By: till

Seems as if you did not install the prerequisites from step 2 of the tutorial.

By: Luis Urbina G.

 Hi Till, Thanks for this tutorial, works fine for me!

I found an error when tried to copy php 7.1 ini

You wrote

cp /usr/local/src/php7.1-build/php-7.1/php.ini-production /opt/php-7.1/lib/php.ini

and is

cp /usr/local/src/php7.1-build/php-7.1.14/php.ini-production /opt/php-7.1/lib/php.ini

thank you man!

By: iamart

Maybe it would be nice to add in compilation php 5.6 switch --with-gd

By: martin

Installed PHP 5.6 and can't connect to mysql-server via mysqli, got this error "Error displaying the error page: Application Instantiation Error: Could not connect to MySQL" from Joomla. Connect via mysql works. php -m shows mysqli as installed. Any hints? Server: ispconfig 3.1.11, Debian 9.3

Thanks and best regards.

By: Roberth

after doing the steps for php 7.2, ispconfig stopped working, giving 502 bad gateway error, any fix?

By: youg

Hello, thanks for the good job done with IPSCONFIG :)

On a fresh Debian 9 / nginx perfect server, I can't start PHP5.6 :

ERROR: [/opt/php-5.6/etc/pear.conf:2] value is NULL for a ZEND_INI_PARSER_ENTRY

PHP:  syntax error, unexpected '{' in Unknown on line 1

I have no idea why ! What can I try to fix it ?

By: icare

Many Thanks for the Tutorial

Config Debian 9 - IcpSonfig 3.1.12 - I had php like the tutorial - I had additionnal php version in ISPconfig -

All is good except : There is no 'PHP Version' when i want to add a new website.

Can you help me

Thanks a lot

By: virtualware

Hello how to activate this extension PHP Extension intl

By: Esther

You need to compile with that feature enabled: --enable-intl

By: Mike

In case you have a 32Bit debian. Do the following:

64Bit: (original commands)ln -s /usr/lib/libc-client.a /usr/lib/x86_64-linux-gnu/libc-client.acd /usr/includeln -s x86_64-linux-gnu/curlPHP 7.1./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-fpmPHP 7.2./configure --prefix=/opt/php-7.2 --with-pdo-pgsql --with-zlib-dir --with-freetype-dir --enable-mbstring --with-libxml-dir=/usr --enable-soap --enable-calendar --with-curl --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 --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-fpm32Bit: (use instead)apt-get install pkg-configln -s /usr/lib/libc-client.a /usr/lib/i386-linux-gnu/libc-client.acd /usr/includeln -s i386-linux-gnu/curlPHP 7.1./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/i386-linux-gnu --enable-ftp --with-imap --with-imap-ssl --with-kerberos --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-fpmPHP 7.2./configure --prefix=/opt/php-7.2 --with-pdo-pgsql --with-zlib-dir --with-freetype-dir --enable-mbstring --with-libxml-dir=/usr --enable-soap --enable-calendar --with-curl --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 --with-openssl --with-fpm-user=www-data --with-fpm-group=www-data --with-libdir=lib/i386-linux-gnu --enable-ftp --with-imap --with-imap-ssl --with-kerberos --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-fpm

-Mike

By: Mike

Please excuse, somehow the formatting got mixed up, I try again:

In case you have a 32Bit Debian, do the following:

Here you have the original 64Bit commands:

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

cd /usr/include

ln -s x86_64-linux-gnu/curl

Replace with:

apt-get install pkg-config

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

cd /usr/include

ln -s i386-linux-gnu/curl

and use the following .configure commands

PHP 7.1

./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/i386-linux-gnu --enable-ftp --with-imap --with-imap-ssl --with-kerberos --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-fpm

PHP 7.2

./configure --prefix=/opt/php-7.2 --with-pdo-pgsql --with-zlib-dir --with-freetype-dir --enable-mbstring --with-libxml-dir=/usr --enable-soap --enable-calendar --with-curl --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 --with-openssl --with-fpm-user=www-data --with-fpm-group=www-data --with-libdir=lib/i386-linux-gnu --enable-ftp --with-imap --with-imap-ssl --with-kerberos --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-fpm

 

note: the --with-libdir=lib/i386-linux-gnu line changes from 64Bit to 32Bit

 

-Mike

By: calbasi

Hi, I get 2 errors with these lines:

mkdir /usr/include/freetype2/freetype

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

Here you have my output (using Catalan locale, but basicaly, these dir and files already exist):

root@civi4:/tmp/openssl-1.0.1t# mkdir /usr/include/freetype2/freetypemkdir: no s’ha pogut crear el directori «/usr/include/freetype2/freetype»: El fitxer ja existeix

root@civi4:/tmp/openssl-1.0.1t# ln -s /usr/include/freetype2/freetype.h /usr/include/freetype2/freetype/freetype.hln: no s’ha pogut crear l’enllaç simbòlic '/usr/include/freetype2/freetype/freetype.h': El fitxer ja existeix

I supose there is a minor issue, but I report it because maybe could be useful to somebody.

By: LIJE

I saw your tuto in here: https://www.howtoforge.com/tutorial/how-to-install-php-5.6-and-7.1-on-debian-9-stretch/ I had PHP v7.0 set up and I added the v5.2 with your help. The problem I have is the following: Link to database cannot be established: SQLSTATE[HY000] [2002] No such file or directory I get this error when I swithced to php 5.2 and I don't know why. Any clue?

By: Leonardo

Hi boys and girls

Recenly install ispconfig with this guide https://www.howtoforge.com/tutorial/perfect-server-debian-9-stretch-apache-bind-dovecot-ispconfig-3-1/ and all ok. Today need install multiple php versions, but i need install(especificly) php-5.3.29... someone nknows how do this without die in the try.

By: Aleksandar

I am getting very weird problem, I have installed php 7.0 as default php on my server and everything works fine, but one website require older script to work, so i followed guide and installed php 5.6. when i switch to that version than website's wont work. I have wordpress on one of installations and on php 7.0 it works, when i switch to php 5.6 FASTCGI i am getting error "can't connect to database" and when i switch to php 5.6 FPM server doesn't work at all, even phpinfo won't display anything. But other websites on php 7.0 works.

By: Pifpof

Mysql issue SQLSTATE[HY000] [2002] should be fixed not using localhost but 127.0.0.1.

Stretch consider localhost to be ipv6 (localhost (::1):) not ipv4(127.0.0.1) so PDO try socket mode instead.

By: Gavin Lewandowski

I am having a problem with PHP 5.6

include=/opt/php-5.6/etc/php-fpm.d/*.conf

I commented the line out, and the process appears to start

However, the vhost configured to use php-5.6 then gives an error 503 Service Unavailable

Logs show - [Thu Sep 27 17:33:49.464829 2018] [proxy:error] [pid 16424] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /var/lib/php7.0-fpm/web5.sock (*) failed

Any pointers?

By: viktor

apt install ca-certificates apt-transport-https 

wget -q https://packages.sury.org/php/apt.gpg -O- | sudo apt-key add -

echo "deb https://packages.sury.org/php/ stretch main" | sudo tee /etc/apt/sources.list.d/php.list

 

apt-get update

 

apt-get -y install apache2 apache2-doc apache2-utils libapache2-mod-php php7.0 php7.0-common php7.0-gd php7.0-mysql php7.0-imap phpmyadmin php7.0-cli php7.0-cgi libapache2-mod-fcgid apache2-suexec-pristine php-pear php7.0-mcrypt mcrypt  imagemagick libruby libapache2-mod-python php7.0-curl php7.0-intl php7.0-pspell php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl memcached php-memcache php-imagick php-gettext php7.0-zip php7.0-mbstring libapache2-mod-passenger php7.0-soap  php7.0-fpm

 

apt-get -y install apache2 apache2-doc apache2-utils libapache2-mod-php php7.1 php7.1-common php7.1-gd php7.1-mysql php7.1-imap phpmyadmin php7.1-cli php7.1-cgi libapache2-mod-fcgid apache2-suexec-pristine php-pear php7.1-mcrypt mcrypt  imagemagick libruby libapache2-mod-python php7.1-curl php7.1-intl php7.1-pspell php7.1-recode php7.1-sqlite3 php7.1-tidy php7.1-xmlrpc php7.1-xsl php-imagick php-gettext php7.1-zip php7.1-mbstring memcached libapache2-mod-passenger php7.1-soap  php7.1-fpm

 

apt-get -y install apache2 apache2-doc apache2-utils libapache2-mod-php php7.2 php7.2-common php7.2-gd php7.2-mysql php7.2-imap phpmyadmin php7.2-cli php7.2-cgi libapache2-mod-fcgid apache2-suexec-pristine php-pear libapache2-mod-python php7.2-curl php7.2-intl php7.2-pspell php7.2-recode php7.2-sqlite3 php7.2-tidy php7.2-xmlrpc php7.2-xsl memcached php-memcache php-imagick php-gettext php7.2-zip php7.2-mbstring libapache2-mod-passenger php7.2-soap  php7.2-fpm

 

apt-get -y install apache2 apache2-doc apache2-utils libapache2-mod-php php7.3 php7.3-common php7.3-gd php7.3-mysql php7.3-imap phpmyadmin php7.3-cli php7.3-cgi libapache2-mod-fcgid apache2-suexec-pristine php-pear imagemagick libruby libapache2-mod-python php7.3-curl php7.3-intl php7.3-pspell php7.3-recode php7.3-sqlite3 php7.3-tidy php7.3-xmlrpc php7.3-xsl php-imagick php-gettext php7.3-zip php7.3-mbstring libapache2-mod-passenger php7.3-soap  php7.3-fpm

 

apt-get -y install apache2 apache2-doc apache2-utils libapache2-mod-php php5.6 php5.6-common php5.6-gd php5.6-mysql php5.6-imap phpmyadmin php5.6-cli php5.6-cgi libapache2-mod-fcgid apache2-suexec-pristine php-pear php5.6-mcrypt mcrypt  imagemagick libruby libapache2-mod-python php5.6-curl php5.6-intl php5.6-pspell php5.6-recode php5.6-sqlite3 php5.6-tidy php5.6-xmlrpc php5.6-xsl  php5.6-zip php5.6-mbstring  libapache2-mod-passenger php5.6-soap php5.6-fpm

 

 

 

 PHP 7.2

 /usr/bin/php-cgi7.2

 /etc/php/7.2/cgi

 

 php7.2-fpm

/etc/php/7.2/fpm

/etc/php/7.2/fpm/pool.d

By: sunghost

Hi,

i wonder how to do if you do an Update for newer PHP Version. If i understand this right, you have first delete all under e.g. /opt/php-7.1, after that you have to run above steps for the newer php-7.1 Version, but in meantime all Websites running php-7.1 will stop working. Right?? So if you dont have a ISPConfig Cluster, i think its a bad idea. Another idea to name fodlers like PHP-Version is ok, but you have manually change alle Paths in ISPConfig Website Configuration. So what is the best way and why there is no Build-in Feature in ISPConfig for that? Make an Update of ISPConfig for the Scripts with some Option in ISPConfig for e.g. Modules and then let it run from GUI <- would be nice or not? Thx Till for your Time and Work.

By: sunghost

Hi,

i wonder how to do if you do an Update for newer PHP Version. If i understand this right, you have first delete all under e.g. /opt/php-7.1, after that you have to run above steps for the newer php-7.1 Version, but in meantime all Websites running php-7.1 will stop working. Right?? So if you dont have a ISPConfig Cluster, i think its a bad idea. Another idea to name fodlers like PHP-Version is ok, but you have manually change alle Paths in ISPConfig Website Configuration. So what is the best way and why there is no Build-in Feature in ISPConfig for that? Make an Update of ISPConfig for the Scripts with some Option in ISPConfig for e.g. Modules and then let it run from GUI <- would be nice or not? Thx Till for your Time and Work.

By: Ricardo Vigatti

Thanks Till, you're the best.

By: Laurent

Hello Till,

I would like to know if it is possible to update the different versions of php, with this installation?

And how to do it automatically?

Best regards

Laurent

By: Roy 1971

i 've a trouble using the tuto , cd php-memcached-php7

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

 

/opt/php-7.2/bin/phpize

 

Configure and build the PHP memcache extension.

 

./configure --with-php-config=/opt/php-7.2/bin/php-configmakemake install

 

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

nano /opt/php-7.2/lib/php.in

./configure --with-php-config=/opt/php-7.2/bin/php-config doesn't work say file doesn't exist, i think there is a directory location trouble, i 've tryed to change the directory cd .. cd .. that changed nothing unsuccesfull

By: george

hello,

There is a way to install or enable "intl" without recompiling PHP 7.2 ??

By: Michel

Hi Tim

Thank you for your work; it's very hepfull

I folowed it and it's worked well but I still with a problem, may be you could help me to find an issue. I'm unalbe to be connected to mysql DB with PHP5.6.

I wrote this php script :

<?php $servername = "localhost"; $username = "username"; $password = "password"; try { $conn = new PDO("mysql:host=$servername;dbname=myDB", $username, $password); // set the PDO error mode to exception $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); echo "Connected successfully"; } catch(PDOException $e) { echo "Connection failed: " . $e->getMessage(); } ?>

I tried it and I got :

/opt//PHP/php-5.6/bin/php connect_db.php Connection failed: SQLSTATE[HY000] [2002] No such file or directory

When I'm using PHP7 I don't have this problem :

/opt//PHP/php-7.1/bin/php connect_db.php Connected successfully 

Do you have any idea where is coming from ?

Regards,

By: Michel

I found an issue if i set the variable $servername

like this  $servername = "127.0.0.1"

/opt//PHP/php-5.6/bin/php connect_db.php Connected successfully 

Thanks 

By: till

Then you might have name resolving disabled in MySQL.

By: PetZe

After applying this procedure, I have the following problem:

If I change the domain name in ISPconfig (eg from subdom.domain.com to subdom1.domain.com) apache will display "Apache2 Debian Default Page".

Renaming back (eg back to subdom.domain.com) does not help. Still showing "Apache2 Debian Default Page".

Changes are visible in the "/ etc / apache2 / sites-available" and "/ etc / apache2 / sites-enabled" directories.

Please help.

By: till

The installation of an additional PHP version is not related to a domain change and the PHP version has no influence on which site is shown by apache, so your problem is probably not related to the use of this tutorial. Support for ISPConfig is available in the ISPConfig forum: https://www.howtoforge.com/community/forums/installation-configuration.27/

By: 30uke

Hello,

Thanks for this howto :-) This howto helped me to compile PHP 7.3. Unfortunately "XDebug" fails. I am just posting my notes below hoping it might be helpful.

 

# ./configure --prefix=/opt/php-7.3 --with-pdo-pgsql --with-zlib-dir --with-freetype-dir --enable-mbstring --with-libxml-dir=/usr --enable-soap --enable-calendar --with-curl --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 --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

 

# Required:

# apt install -y libzip-dev

 

# MemCached

# Required:

# wget https://codeload.github.com/php-memcached-dev/php-memcached/zip/master -O php-memcached-master.zip

# I did copy the contents of the master into the php-memcached-php7 directory and then ran phpize and next followed the howto...

 

#XDebug

# pecl -C ./pear.conf install xdebug #this fails... :(

 

# root@s1:/opt/php-7.3/bin# ./php --version

# PHP 7.3.0 (cli) (built: Jan  6 2019 22:27:08) ( NTS )

# Copyright (c) 1997-2018 The PHP Group

# Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies

#     with Zend OPcache v7.3.0, Copyright (c) 1999-2018, by Zend Technologies

 

# So far, so good. To do: enable PHP 7.3 in ISPconfig

By: 30uke

Just an update --- adding my notes again - with regards to freetype2 on Debian 10:

[code]

Uitgangspunt versie 7.2 toepassen op 7.3 voor Buster:

https://www.howtoforge.com/tutorial/how-to-install-php-7-on-debian/

 

Probleem met freetype2; oplossing hier direct onder...

 

https://debianforum.de/forum/viewtopic.php?t=174744

 

Ich glaub ich hab das Problem gelöst

Vorgehensweise:

cd /tmp

git clone git://git.sv.nongnu.org/freetype/freetype2.git

cd freetype2

./autogen.sh

./configure --enable-freetype-config --prefix=/opt/freetype2

make

make install

 

und beim kompilieren von PHP das hinzufügen:

--with-freetype-dir=/opt/freetype2

 

PHP 7.3 kan dan compiled worden met:

./configure --prefix=/opt/php-7.3 --with-pdo-pgsql --with-zlib-dir --with-freetype-dir=/opt/freetype2 --enable-mbstring --with-libxml-dir=/usr --enable-soap --enable-calendar --with-curl --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 --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

 

 

cp /usr/local/src/php7.3-build/php-7.3.11/php.ini-production /opt/php-7.3/lib/php.ini

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

cp /opt/php-7.3/etc/php-fpm.d/www.conf.default /opt/php-7.3/etc/php-fpm.d/www.conf

 

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

 

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

 

[...]

listen = 127.0.0.1:8998

[...]

 

 

wget -N https://github.com/php-memcached-dev/php-memcached/archive/master.zip

unzip master.zip

cd php-memcached-master

/opt/php-7.3/bin/phpize

./configure --with-php-config=/opt/php-7.3/bin/php-config

make -j `cat /proc/cpuinfo | grep processor | wc -l`

make test

 

 

You should add "zend_extension=/opt/php-7.3/lib/php/extensions/no-debug-non-zts-20180731/xdebug.so" to php.ini

[/code]

By: clixclix

Hi everybody, hi Till,

Let me share some useful information.

I followed yor guide in order to use php5.6-fpm on a Debian 9 OS with ISPConfig3.

Everything worked correctly, except for "curl_exec" calls with HTTPS protocol, which caused a crash like this:

[07-Jan-2019 17:48:58] WARNING: [pool web1] child 2641 said into stderr: "*** Error in `php-fpm: pool web1': free(): invalid pointer: 0x0000558468680690 ***"[07-Jan-2019 17:48:58] WARNING: [pool web1] child 2641 said into stderr: "======= Backtrace: ========="[07-Jan-2019 17:48:58] WARNING: [pool web1] child 2641 said into stderr: "/lib/x86_64-linux-gnu/libc.so.6(+0x70bfb)[0x7f926714abfb]"[07-Jan-2019 17:48:58] WARNING: [pool web1] child 2641 said into stderr: "/lib/x86_64-linux-gnu/libc.so.6(+0x76fc6)[0x7f9267150fc6]"[07-Jan-2019 17:48:58] WARNING: [pool web1] child 2641 said into stderr: "/lib/x86_64-linux-gnu/libc.so.6(+0x7780e)[0x7f926715180e]"[07-Jan-2019 17:48:58] WARNING: [pool web1] child 2641 said into stderr: "/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0(CRYPTO_free+0x1d)[0x7f926a851ffd]"[07-Jan-2019 17:48:58] WARNING: [pool web1] child 2641 said into stderr: "/usr/lib/x86_64-linux-gnu/libssl.so.1.0.2(SSL_CTX_set_alpn_protos+0x1d)[0x7f9262cb8a7d]"[07-Jan-2019 17:48:58] WARNING: [pool web1] child 2641 said into stderr: "/usr/lib/x86_64-linux-gnu/libcurl.so.4(+0x5e9fc)[0x7f92679c59fc]"

 

After some investigation, I re-installed the openssl package, using version 1.0.2p instead of 1.0.1t.

Afted that, curl_exec with HTTPS started working without errors.

Here are the commands I executed:

cd /tmpwget "https://www.openssl.org/source/old/1.0.2/openssl-1.0.2p.tar.gz"tar xzf openssl-1.0.2p.tar.gz cd openssl-1.0.2p./config shared --prefix=/opt/opensslmake -j $(nproc) && make installln -s /opt/openssl/lib /opt/openssl/lib/x86_64-linux-gnuwget -O /opt/openssl/ssl/cert.pem "http://curl.haxx.se/ca/cacert.pem

I hope this could help someone.

 

By: clixclix

-- re-sending comment with better text formatting --

Hi everybody, hi Till,Let me share some useful information.I followed yor guide in order to use php5.6-fpm on a Debian 9 OS with ISPConfig3.Everything worked correctly, except for "curl_exec" calls with HTTPS protocol, which caused a crash like this:[07-Jan-2019 17:48:58] WARNING: [pool web1] child 2641 said into stderr: "*** Error in `php-fpm: pool web1': free(): invalid pointer: 0x0000558468680690 ***"[07-Jan-2019 17:48:58] WARNING: [pool web1] child 2641 said into stderr: "======= Backtrace: ========="[07-Jan-2019 17:48:58] WARNING: [pool web1] child 2641 said into stderr: "/lib/x86_64-linux-gnu/libc.so.6(+0x70bfb)[0x7f926714abfb]"[07-Jan-2019 17:48:58] WARNING: [pool web1] child 2641 said into stderr: "/lib/x86_64-linux-gnu/libc.so.6(+0x76fc6)[0x7f9267150fc6]"[07-Jan-2019 17:48:58] WARNING: [pool web1] child 2641 said into stderr: "/lib/x86_64-linux-gnu/libc.so.6(+0x7780e)[0x7f926715180e]"[07-Jan-2019 17:48:58] WARNING: [pool web1] child 2641 said into stderr: "/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0(CRYPTO_free+0x1d)[0x7f926a851ffd]"[07-Jan-2019 17:48:58] WARNING: [pool web1] child 2641 said into stderr: "/usr/lib/x86_64-linux-gnu/libssl.so.1.0.2(SSL_CTX_set_alpn_protos+0x1d)[0x7f9262cb8a7d]"[07-Jan-2019 17:48:58] WARNING: [pool web1] child 2641 said into stderr: "/usr/lib/x86_64-linux-gnu/libcurl.so.4(+0x5e9fc)[0x7f92679c59fc]"[...]After some investigation, I re-installed the openssl package, using version 1.0.2p instead of 1.0.1t.Afted that, curl_exec with HTTPS started working without errors.Here are the commands I executed:cd /tmpwget "https://www.openssl.org/source/old/1.0.2/openssl-1.0.2p.tar.gz"tar xzf openssl-1.0.2p.tar.gzcd openssl-1.0.2p./config shared --prefix=/opt/opensslmake -j $(nproc) && make installln -s /opt/openssl/lib /opt/openssl/lib/x86_64-linux-gnuwget -O /opt/openssl/ssl/cert.pem "http://curl.haxx.se/ca/cacert.pemI hope this could help someone.

 

By: M

Thanks!

By: Will Berger

Wow thank you for that comment!  I had to install openssl1.0.2 recompile 5.6 in order to get the system to stop crashing on certain wordpress pages.

with the following erro "*** Error in `php-fpm: pool web1': free(): invalid pointer

If you look at the stack trace gives you a clue as it goes through the ssl stack through curl.

Hope this helps someone gain back a few hours of their lives :)

 

By: C0rt3x

Hello,To start thank you for this tutorial very well detailed and very well presented.

I am on debian9 and ISPC3 V3.1.13.

My problem occurs after this command line:

 

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

/opt/php-7.1/bin/phpize

 

I receive this error in return:

 

Configuring for:PHP Api Version: 20160303Zend Module Api No: 20160303Zend Extension Api No: 320160303Cannot find autoconf. Please check your autoconf installation and the$PHP_AUTOCONF environment variable. Then, rerun this script.

 

Do you have any idea where my problem comes from,

I specify that I am on a dedicated server.

By: C0rt3x

apt-get install autoconf
apt-get install pkg-config and is good

By: nut

Hello, Till, thanks for this great tutorial! We use sury.org to install php 7.2 over apt. We then manually make them known to the system via the ISPConfig interface as an additional PHP version. However, if multiple pages are configured with PHP-PFM, ISPConfig creates the variable for *.sock in the *.conf files, for each page with a default value that leads to a "503 Service Unavailable" error. ([proxy:error] [pid 18991] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /var/lib/php7.0-fpm/web11.sock (*) failed) Sometimes, the first and only one Page in ISPConfig is configured with PHP-PFM, it works. If a second is configured with PHP-PFM we get a 503 error. /etc/apache2/sites-available/anydomain.de.vhost: ISPConfig generates with PHP-PFM 7.2 configured: ... Require all granted SetHandler php-fcgi SetHandler php-fcgi Action php-fcgi /php-fcgi virtual Alias /php-fcgi /var/www/clients/client0/web11/cgi-bin/php-fcgi-*-80-anydomain.de FastCgiExternalServer /var/www/clients/client0/web11/cgi-bin/php-fcgi-*-80-anydomain.de -idle-timeout 300 -socket /var/lib/php7.0-fpm/web11.sock -pass-header Authorization -pass-header Content-Type #ProxyPassMatch ^/(.*\.php[345]?(/.*)?)$ unix:///var/lib/php7.0-fpm/web11.sock|fcgi://localhost//var/www/clients/client0/web11/web/$1 SetHandler "proxy:unix:/var/lib/php7.0-fpm/web11.sock|fcgi://localhost" ... We have to change all /var/lib/php7.0-fpm/web11.sock -> /run/php/php7.2-fpm.sock (/run/php/web11.sock should work too) And in /etc/php/7.2/fpm/pool.d/web11.conf ISPConfig generates: ... [web11] listen = /var/lib/php7.0-fpm/web11.sock listen.owner = web11 listen.group = www-data listen.mode = 0660 ... We have to change /var/lib/php7.0-fpm/web11.sock -> /run/php/php7.2-fpm.sock listen.owner we set to www-data (web11 should work too I think?) If done, then no 503 error will be thrown. I think this is a fundamental bug in the templates used to generate the conf files?! Can we edit these templates ourselves? If so, where are these stored? Thanks and best regards. Helmut

By: till

The socket path as created by ispconfig is fine, for web11 the path has to be /var/lib/php7.0-fpm/web11.sock  independantly of the used PHP version, the 7.0 in the path does not refer to the PHP version used by that site, its just an ordinary folder name and in this case the system wide PHP socket folder used by all PHP versions. I use several PHP versions from sury here with multiple websites and don't have any issues and there are a few hundred thousand ISPConfig installs that use multiple PHP versions which work without issues as well, so you can rest assured that there is no template bug and that the path is correct. Changing the path manually to /run/php/php7.2-fpm.sock is a huge mistake though as you switched the PHP user from web user to www-data by that which allows access from all sites on your server to other sites and CMS updates will fail on all sites, so revert that. Most likely one of your PHP FPM daemons is not working correctly or it has not been started by systemd which can cause daemon reload failures, try to restart the daemons for all versions or reboot the server.  If you need further help with the issue on your server, then please post in the ISPConfig forum.

By: Xym

I have the same problem, with ubuntu 18.04 / Apache 2 & PHP-FPM7.2, 4 reinstallation of the server, i keep all the tutorial. At the finish i create one website with php-fpm in defaut conf. i upload my files, i check and error 503.

Very frustrating, i have looked for many days to find a solution,  and i think i'm not the only one with this problem.

Did you find a solution Nut ?

Happy to read you.

X

By: figoo

Please advise how to completly uninstall it (7.2.8) when I do not need it anymore??

 

By: Ludo

Thanks Till for this tuto! Worked like a charm for me (Debian Stretch, ISPConfig 3.1.13p1). I only installed PHP 5.6.

By: Tim

Thank you very mich Till, gerat tutorial. I use PHP 7.2. Can you explain how to install imagick, php-intl or other extensions for this version?

By: willi

tried the new version w/o imap but failed at php7.2 make with the same errors:/usr/lib/x86_64-linux-gnu/libssl.so.1.1: error adding symbols: DSO missing from command and „sapi/cli/php“ As I did not manage to upgrade Drupal6 to 7 I want to implement php5.2.17 an my own ISPconfig-Server. willi

By: coozila

cp /usr/local/src/php7.1-build/php-7.1/php.ini-production /opt/php-7.1/lib/php.ini

cp /usr/local/src/php7.1-build/php-7.1.14/php.ini-production /opt/php-7.1/lib/php.ini

the corect link

By: Ernesto Caligiuri

Hi to everybody 

Thank you very much , for this tutorial , i have done everything and installed php 7.2.16 , no compile errors, from command line /opt/php-7.2/bin/php --version is ok .

I added it in ISPCONFIG , but when i use php-fpm and choose my version of php on a website phpinfo() reply to me always with a blank page and i have so in accces.log  , error log is empty:

[01/Apr/2019:16:23:10 +0200] "GET /check.php HTTP/1.1" 304 179 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0"

I use Debian 8.11 .

Somebody can help me ? Thanks in advance 

Ernesto

By: wojtekgoral

Thanks for the great tutorial. As of today 2019-04-29 the only thing I had to do different is the path:

You have to replace the commandcp /usr/local/src/php7.1-build/php-7.1/php.ini-production /opt/php-7.1/lib/php.iniby:cp /usr/local/src/php7.1-build/php-7.1.14/php.ini-production /opt/php-7.1/lib/php.ini

By: Markus

I'm a bit at a loss: I successfully installed php-7.2.16 according to this tutorial on my machine. Now I want to upgrade my PHP to 7.2.17. How would I do this?

do it like:

mkdir -p /opt/php-7.2.18mkdir /usr/local/src/php7.2.18-buildcd /usr/local/src/php7.2.18-buildwget http://de2.php.net/get/php-7.2.18.tar.bz2/from/this/mirror -O php-7.2.18.tar.bz2tar jxf php-7.2.18.tar.bz2

I guess, this would then give me a php 7.2.18 additional to my existing 7.2.16 instead of replacing my old php version. I could live with this, but later on when setting up the port, php schould listen to:

[...] listen = 127.0.0.1:8998 [...]

will I need to enter still another port for 7.2.18, like 8999?

 

By: massdok

How to fix ?  configure: error: libcrypto not found!

By: micp

Great! Works like a charm.

Now, will download my 5.6 files and test.

Thank you so much, I've learned a lot again!

By: Freebox

Bad command:

cp /usr/local/src/php7.1-build/php-7.1/php.ini-production /opt/php-7.1/lib/php.ini

Good command:

cp /usr/local/src/php7.1-build/php-7.1.14/php.ini-production /opt/php-7.1/lib/php.ini

By: Freebox

Before:

/opt/php-7.1/bin/phpize

you must install autoconf:

apt install autoconf

By: Freebox

Before:

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

you must:

apt install re2c pkg-config

By: jboud

Hey Till, will this guide apply on debian 10 as well?

By: Hawkman

PHP 7.2.21 OK, but memcache dont work.

  PHP Version 7.2.21System     Linux servidor 4.9.0-9-amd64 #1 SMP Debian 4.9.168-1+deb9u5(2019-08-11) x86_64Build Date     Aug 26 2019 10:09:45Configure Command     './configure' '--prefix=/opt/php-7.2''--with-pdo-pgsql' '--with-zlib-dir' '--with-freetype-dir''--enable-mbstring' '--with-libxml-dir=/usr' '--enable-soap''--enable-calendar' '--with-curl' '--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' '--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'Server API     CGI/FastCGIVirtual Directory Support     disabledConfiguration File (php.ini) Path     /opt/php-7.2/libLoaded Configuration File     /opt/php-7.2/lib/php.iniScan this dir for additional .ini files     (none)Additional .ini files parsed     (none)PHP API     20170718PHP Extension     20170718Zend Extension     320170718Zend Extension Build     API320170718,NTSPHP Extension Build     API20170718,NTSDebug Build     noThread Safety     disabledZend Signal Handling     enabledZend Memory Manager     enabledZend Multibyte Support     provided by mbstringIPv6 Support     enabledDTrace Support     disabledRegistered PHP Streams    https, ftps, compress.zlib, compress.bzip2, php,file, glob, data, http, ftp, phar, zipRegistered Stream Socket Transports    tcp, udp, unix, udg, ssl, tls,tlsv1.0, tlsv1.1, tlsv1.2Registered Stream Filters    zlib.*, bzip2.*, convert.iconv.*,string.rot13, string.toupper, string.tolower, string.strip_tags,convert.*, consumed, dechunkZend logo <http://www.zend.com/> This program makes use of the ZendScripting Language Engine:Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

.........................................................

    memcachedmemcached support    enabledVersion     3.1.3libmemcached version     1.0.18SASL support     yesSession support     yesigbinary support     nojson support     nomsgpack support     noDirective    Local Value    Master Valuememcached.compression_factor    1.3    1.3memcached.compression_threshold    2000    2000memcached.compression_type    fastlz    fastlzmemcached.default_binary_protocol    Off    Offmemcached.default_connect_timeout    0    0memcached.default_consistent_hash    Off    Offmemcached.serializer    php    phpmemcached.sess_binary_protocol    On    Onmemcached.sess_connect_timeout    0    0memcached.sess_consistent_hash    On    Onmemcached.sess_consistent_hash_type    ketama    ketamamemcached.sess_lock_expire    0    0memcached.sess_lock_max_wait    not set    not setmemcached.sess_lock_retries    5    5memcached.sess_lock_wait    not set    not setmemcached.sess_lock_wait_max    150    150memcached.sess_lock_wait_min    150    150memcached.sess_locking    On    Onmemcached.sess_number_of_replicas    0    0memcached.sess_persistent    Off    Offmemcached.sess_prefix    memc.sess.key.    memc.sess.key.memcached.sess_randomize_replica_read    Off    Offmemcached.sess_remove_failed_servers    Off    Offmemcached.sess_sasl_password    /no value/    /no value/memcached.sess_sasl_username    /no value/    /no value/memcached.sess_server_failure_limit    0    0memcached.store_retry_count    2    2

By: Niclas

Danke für die Anleitung! Alles super gelaufen :) Frage: Wie kann ich --enable-intl nachträglich installieren? Startet man dazu ./configure mit der Ergänzung neu und danach make + make install?

By: Tata

All good (with corrections in the comments). Page changed to pHP 7.2. But after logging into the client ssh account:$ php -v

PHP 7.0.33-0+deb9u3 (cli) ...

Composer for Symfony 4 doesn't work... :)

By: LyrX

Problem since Debian (10) Buster: configure: error: freetype-config not found.The only thing to workaround so far is to compile withouth freetype. Anybody have a solution, to get this working?

By: jboud

I would also love a guide for debian 10 64 for multiple php versions. Following this guide on debian 10, produces errors.

By: jkladola

Replace  "--with-freetype-dir" with "--with-freetype" as per official php docs,https://www.php.net/manual/en/image.installation.phpFind section "Supported font libraries" in above link.

By: Cip

Great! This helped me!

Thanks

By: Blacklevel

How to enable the intl extension on

php7.2, php7.1 installed? Please help!

By: Sebastian

Hi! 

i have problem - service apache stops at any time - i see this in /var/log/apache2/error.log

 

PHP Warning:  PHP Startup: Unable to load dynamic library 'intl' (tried: /opt/php-7.2/lib/php/extensions/no-debug-non-zts-20170718/intl (/opt/php-7.2/lib/php/extensions/no-debug-non-zts-20170718/intl: cannot open shared object file: No such file or directory), /opt/php-7.2/lib/php/extensions/no-debug-non-zts-20170718/intl.so (/opt/php-7.2/lib/php/extensions/no-debug-non-zts-20170718/intl.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

 

How to repair this problem?

Best regards!

By: tanaka

My queue is freezed, i look into the cron.log, where i found :

Tue Nov 19 21:01:01 CET 2019 #7 /usr/local/ispconfig/server/cron.php(116): cronjob->run()Tue Nov 19 21:01:01 CET 2019 #8 {main}Tue Nov 19 21:01:01 CET 2019 thrown in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 523Tue Nov 19 21:01:01 CET 2019 PHP Fatal error:  Uncaught Error: Call to undefined function mb_detect_encoding() in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php:523Tue Nov 19 21:01:01 CET 2019 Stack trace:Tue Nov 19 21:01:01 CET 2019 #0 /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php(183): db->escape('%:/opt/php-7.2/...')Tue Nov 19 21:01:01 CET 2019 #1 /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php(301): db->_build_query_string('SELECT * FROM w...', '%:/opt/php-7.2/...')Tue Nov 19 21:01:01 CET 2019 #2 /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php(340): db->_query('SELECT * FROM w...', '%:/opt/php-7.2/...')Tue Nov 19 21:01:01 CET 2019 #3 /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php(389): db->query('SELECT * FROM w...', '%:/opt/php-7.2/...')Tue Nov 19 21:01:01 CET 2019 #4 /usr/local/ispconfig/server/plugins-available/apache2_plugin.inc.php(194): db->queryAllRecords('SELECT * FROM w...', '%:/opt/php-7.2/...')Tue Nov 19 21:01:01 CET 2019 #5 /usr/local/ispconfig/server/lib/classes/plugins.inc.php(156): apache2_plugin->php_ini_changed('php_ini_changed', Array)Tue Nov 19 21:01:01 CET 2019 #6 /usr/local/ispconfig/server/plugins-available/webserver_plugin.inc.php(154): plugins->raiseAction('php_ini_changed', Array)Tue Nov 19 21:01:01 CET 2019 #7 /usr/local/isp in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 523

By: Jesus

Great input, but please could be for Debian 10

By: Daniel Gil

Hello Till,I have a debian 9 server updated. I have installed the 7. 2 php version and all the process is ok but when i try to enable the PHP version on every site in the PHP version only appears the DEFAULT. Nothing more.I have another two  debian servers that works right so i dont know what to do. I have tried :service apache2 reloadReboot the complete server. Any ideas?Thanks in advance.

By: Dragos

Excellent work, thank you!

 

I had to install php7.0 on Debian 10.

I followed the steps for php7.1 and everything worked flawlessly except 2 parts:

1. I had to recompile freetype-2.10.1 as Debian 10 no longer include freetype-config which is required by php 7.0

wget https://downloads.sourceforge.net/project/freetype/freetype2/2.10.1/freetype-2.10.1.tar.gz

tar -xzf freetype-2.10.1.tar.gz

sed -ri "s:.*(AUX_MODULES.*valid):\1:" modules.cfg &&

sed -r "s:.*(#.*SUBPIXEL_RENDERING) .*:\1:"     -i include/freetype/config/ftoption.h  &&

./configure --prefix=/usr --enable-freetype-config --disable-static &&

make

make install &&

cp builds/unix/freetype-config /usr/bin

 

2. I had to install pkg-config in order to compile memcached

apt-get install pkg-config

 

Thank you again!

All the best

 

By: yatoula

Hello, I can't activate php 7.2 on all servers. Php 7.0.33 agoIf someone can watch my server ... thank you I crack after 4 days.

By: Martin

Hello!Thank you very much, the tutorial works perfectly. Can you please tell me, how to add APCu support for the additional php versions (7.1 or 7.2) ?I can't see any options in .configure --help like --with-apcu or similar...Thanks a million!

By: fbarcenas

Great! guide!! I can't wait for the buster update.

By: till

I recommend to use this guide for Buster, I won't compile it myself anymore as the packages from sury.org are really good and you have the benefit of not having to recompile for security updates. https://www.howtoforge.com/tutorial/how-to-install-php-7-for-ispconfig-3-from-debian-packages-on-debian-8-and-9/

By: Vagner

Hallo Till,

 

It´s possible update the version PHP 7.2 or install new version PHP 7.3, 7.4... in the ISPConfig 3.1 (Debian 9)?

 

grateful

Vagner

By: coozila

cp /usr/local/src/php7.1-build/php-7.1/php.ini-production /opt/php-7.1/lib/php.ini its wrong the corect patch its

cp /usr/local/src/php7.1-build/php-7.1.14/php.ini-production /opt/php-7.1/lib/php.ini

since this version is php7.1-build/php-7.1.14 not php7.1-build/php-7.1