Menü Schließen

ISPConfig3 mit PHP 7.1 – PHP 7.2 und PHP 7.3 für Apache

ISPConfig Logo

Installiert ist Debian Stretch, was zuvor von Jessie aktualisiert wurde. Dementsprechend ist PHP 5.6.x und PHP 7.0.x installiert. Nachfolgend soll zusätzlich PHP 7.1 und PHP 7.2 als FastCGI und PHP-FPM unter Apache installiert werden.

Als Erinnerung zum Ende des Security Support der PHP-Versionen:

  • PHP 5.6
    • bis 31.12.2018
    • aktuell = 5.6.38
  • PHP 7.0
    • bis 03.12.2018
    • aktuell = 7.0.32
  • PHP 7.1
    • bis 01.12.2019
    • aktuell = 7.1.33
  • PHP 7.2
    • bis 30.11.2020
    • aktuell = 7.2.25
  • PHP 7.3
    • bis 06.12.2021
    • aktuell = 7.3.12

Ich werde hier folgende PHP Module installieren (todo):

  • intl

Vorbereitung


# apt-get install build-essential nano
# apt-get install libfcgi-dev libfcgi0ldbl libjpeg62-turbo-dev libmcrypt-dev libssl-dev libc-client2007e libc-client2007e-dev libxml2-dev libbz2-dev libcurl4-openssl-dev libjpeg-dev libpng-dev libfreetype6-dev libkrb5-dev libpq-dev libxml2-dev libxslt1-dev

PHP und IMAP Support

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

Vorbereitung für PHP mit –with-imap –with-imap-ssl

löst Fehler “configure: error: Cannot find imap library (libc-client.a). Please check your c-client installation.”

# cd /usr/include
# ln -s x86_64-linux-gnu/curl

PHP 7.1 FastCGI und PHP-FPM installieren


# mkdir -p /opt/php-7.1
# mkdir /usr/local/src/php7.1-build
# cd /usr/local/src/php7.1-build
# wget https://www.php.net/distributions/php-7.1.33.tar.bz2 -O php-7.1.33.tar.bz2
# tar jxfv php-7.1.33.tar.bz2
# cd php-7.1.33/

PHP kompilieren

./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-intl --enable-fpm
# make
# make test
# make install
Installing shared extensions:     /opt/php-7.1/lib/php/extensions/no-debug-non-zts-20160303/
Installing PHP CLI binary:        /opt/php-7.1/bin/
Installing PHP CLI man page:      /opt/php-7.1/php/man/man1/
Installing PHP FPM binary:        /opt/php-7.1/sbin/
Installing PHP FPM defconfig:     skipping
Installing PHP FPM man page:      /opt/php-7.1/php/man/man8/
Installing PHP FPM status page:   /opt/php-7.1/php/php/fpm/
Installing phpdbg binary:         /opt/php-7.1/bin/
Installing phpdbg man page:       /opt/php-7.1/php/man/man1/
Installing PHP CGI binary:        /opt/php-7.1/bin/
Installing PHP CGI man page:      /opt/php-7.1/php/man/man1/
Installing build environment:     /opt/php-7.1/lib/php/build/
Installing header files:          /opt/php-7.1/include/php/
Installing helper programs:       /opt/php-7.1/bin/
  program: phpize
  program: php-config
Installing man pages:             /opt/php-7.1/php/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /opt/php-7.1/lib/php/
[PEAR] Archive_Tar    - already installed: 1.4.7
[PEAR] Console_Getopt - already installed: 1.4.2
[PEAR] Structures_Graph- already installed: 1.1.1
[PEAR] XML_Util       - already installed: 1.4.3
[PEAR] PEAR           - already installed: 1.10.9
Wrote PEAR system config file at: /opt/php-7.1/etc/pear.conf
You may want to add: /opt/php-7.1/lib/php to your php.ini include_path
/usr/local/src/php7.1-build/php-7.1.33/build/shtool install -c ext/phar/phar.phar /opt/php-7.1/bin
ln -s -f phar.phar /opt/php-7.1/bin/phar
Installing PDO headers:           /opt/php-7.1/include/php/ext/pdo/

Nun php.ini und php-fpm.conf kopieren. bei PHP-Update nicht notwendig:

Pfad und Link zur php.ini hinzufügen

# /usr/local/src/php7.1-build/php-7.1.33/build/shtool install -c ext/phar/phar.phar /opt/php-7.1/bin
# ln -s -f phar.phar /opt/php-7.1/bin/phar

Schritte sind bei PHP-Update nicht unbedingt notwendig.

# cp /usr/local/src/php7.1-build/php-7.1.23/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

Nun nachfolgende Optionen in der php-fpm.conf aktivieren

Schritte sind bei PHP-Update nicht unbedingt notwendig.

  1. # nano /opt/php-7.1/etc/php-fpm.conf
    1. pid = run/php-fpm.pid
    2. error_log=/var/log/php-fpm.log

PHP – freien Port (8998 oder 8999 oder 9000) einstellen

  1. benutzte(r) Port anzeigen: # netstat -tulpn |grep php-fpm
    tcp 0 0 127.0.0.1:9002 0.0.0.0:* LISTEN 1867/php-fpm.conf)
    tcp 0 0 127.0.0.1:9003 0.0.0.0:* LISTEN 1869/php-fpm.conf)
  2. neuen Port setzen: # nano /opt/php-7.1/etc/php-fpm.d/www.conf
    1. listen = 127.0.0.1:9004

Systemd Unit File erstellen, bei PHP-Update nicht notwendig

# nano /lib/systemd/system/php7.1-fpm.service

[Unit]
Description=The PHP 7.1 FastCGI Process Manager
After=network.target
[Service]
Type=simple
PIDFile=/opt/php-7.1/var/run/php-fpm.pid
ExecStart=/opt/php-7.1/sbin/php-fpm --nodaemonize –-fpm-config /opt/php-7.1/etc/php-fpm.conf
ExecReload=/bin/kill -USR2 $MAINPID
[Install]
WantedBy=multi-user.target

Service aktivieren und Starten

# systemctl enable php7.1-fpm.service
# systemctl daemon-reload
# systemctl start php7.1-fpm.service

oder bei PHP-Update
# systemctl restart php7.1-fpm.service
Status prüfen:
# systemctl status -l php7.1-fpm.service

Zend OPcache aktivieren

Schritte sind bei PHP-Update nicht unbedingt notwendig.

  1. nano /opt/php-7.1/lib/php.ini und am Ende folgendes hinzufügen: zend_extension=opcache.so
  2. PHP Version testen:
    1. # cd /opt/php-7.1/bin
    2. # ./php --version
      PHP 7.1.23 (cli) (built: Oct 23 2018 18:27:10) ( NTS )
      Copyright (c) 1997-2018 The PHP Group
      Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
      with Zend OPcache v7.1.23, Copyright (c) 1999-2018, by Zend Technologies

Memcached aktivieren

Schritte sind bei PHP-Update nicht unbedingt notwendig.

Installieren: # apt-get install libmemcached-dev

nun in PHP 7.1 einbinden:

# mkdir /usr/local/src/php7.1-build/php-memcached
# cd /usr/local/src/php7.1-build/php-memcached
# wget https://github.com/php-memcached-dev/php-memcached/archive/php7.zip
# unzip php7.zip
# cd php-memcached-php7
# /opt/php-7.1/bin/phpize
# ./configure --with-php-config=/opt/php-7.1/bin/php-config
# make
# make test
# make install

Memcached Extension in PHP 7.1 an das Ende hinzufügen
# nano /opt/php-7.1/lib/php.ini
extension=memcached.so

Memcached alternative mittels PECL installieren

# pecl -C ./pear.conf channel-update pecl.php.net
# cd /opt/php-7.1/etc
# pecl -C ./pear.conf install memcached
libmemcached directory [no] : no 
zlib directory [no] : no
use system fastlz [no] : no
enable igbinary serializer [no] : no
enable msgpack serializer [no] : no
enable json serializer [no] : no
enable server protocol [no] : no
enable sasl [yes] : yes
enable sessions [yes] : yes
Build process completed successfully

Memcached Extension in PHP 7.1 an das Ende hinzufügen
# nano /opt/php-7.1/lib/php.ini
extension=memcached.so

# systemctl restart php7.1-fpm
# systemctl status ph7.1-fpm

Memcached überprüfen

# /opt/php-7.1/bin/php -i |grep -A2 -i "memcached support"
memcached support => enabled
Version => 3.1.4
libmemcached version => 1.0.18

xDebug aktivieren

Schritte sind bei PHP-Update nicht unbedingt notwendig.

# cd /opt/php-7.1/etc
# pecl -C ./pear.conf channel-update pecl.php.net
# pecl -C ./pear.conf install xdebug

Extension an das Ende hinzufügen:

# nano /opt/php-7.1/lib/php.ini
zend_extension=/opt/php-7.1/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so
# systemctl start php-7.1fpm.service
# systemctl status -l php7.1-fpm.service

PHP imagick installieren

Schritte sind bei PHP-Update nicht unbedingt notwendig.

# apt-get install libmagickwand-dev
# cd /opt/php-7.1/etc
# pecl -C ./pear.conf channel-update pecl.php.net
# pecl -C ./pear.conf install imagick
# Please provide the prefix of ImageMagick installation [autoconfig]: enter

PHP imagick Extension in PHP 7.1 an das Ende hinzufügen

# nano /opt/php-7.1/lib/php.ini
extension=imagick.so

# systemctl start php7.1-fpm.service
# systemctl status -l php7.1-fpm.service

PHP 7.1 in ISPConfig aktivieren

Schritte sind bei PHP-Update nicht notwendig.

Im Menü unter: unter Sysetm > Zusätzliche PHP Versionen (System > Additional PHP Versions) neue Version hinzufügen.

ISPConfig - weitere PHP Versionen
ISPConfig – weitere PHP Versionen

Dort im ersten Reiter “Name” ensprechend “PHP7.1” eintragen.

ISPConfig PHP Version Name
ISPConfig PHP Version Name

Im Reiter “FastCGI Settings” folgendes eintragen:

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

ISPConfig Add PHP 7.1 FastCGI Paths
ISPConfig Add PHP 7.1 FastCGI Paths

Nun im Reiter “PHP-FPM Settings” folgendes eintragen:

Path to the PHP-FPM init script: php7.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

ISPConfig Add PHP 7.1 FPM Paths
ISPConfig Add PHP 7.1 FPM Paths

Abschließend die Konfiguration Speichern

aufräumen und Downloads löschen# rm /usr/local/src/php7.1-build


PHP 7.2 FastCGI und PHP-FPM installieren


Download und entpacken

# mkdir -p /opt/php-7.2
# mkdir /usr/local/src/php7.2-build
# cd /usr/local/src/php7.2-build
# wget http://de2.php.net/get/php-7.2.25.tar.bz2/from/this/mirror -O php-7.2.25.tar.bz2
# tar jxfv php-7.2.25.tar.bz2
# cd php-7.2.25
  • Support für mcrypt ist in PHP 7.2 nicht vorhanden , daher entfernt --with-mcrypt Anwendungen sollten openssl oder sodium für die Verschlüsselung verwenden
  • Support für Native TrueType String Functionen wurde in PHP 7.2 entfernt --enable-gd-native-ttf
# ./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-intl --enable-fpm

Paket erstellen und installieren

# make
# make test
# make install
Installing shared extensions:     /opt/php-7.2/lib/php/extensions/no-debug-non-zts-20170718/
Installing PHP CLI binary:        /opt/php-7.2/bin/
Installing PHP CLI man page:      /opt/php-7.2/php/man/man1/
Installing PHP FPM binary:        /opt/php-7.2/sbin/
Installing PHP FPM defconfig:     skipping
Installing PHP FPM man page:      /opt/php-7.2/php/man/man8/
Installing PHP FPM status page:   /opt/php-7.2/php/php/fpm/
Installing phpdbg binary:         /opt/php-7.2/bin/
Installing phpdbg man page:       /opt/php-7.2/php/man/man1/
Installing PHP CGI binary:        /opt/php-7.2/bin/
Installing PHP CGI man page:      /opt/php-7.2/php/man/man1/
Installing build environment:     /opt/php-7.2/lib/php/build/
Installing header files:          /opt/php-7.2/include/php/
Installing helper programs:       /opt/php-7.2/bin/
  program: phpize
  program: php-config
Installing man pages:             /opt/php-7.2/php/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /opt/php-7.2/lib/php/
[PEAR] Archive_Tar    - already installed: 1.4.7
[PEAR] Console_Getopt - already installed: 1.4.2
[PEAR] Structures_Graph- already installed: 1.1.1
[PEAR] XML_Util       - already installed: 1.4.3
[PEAR] PEAR           - already installed: 1.10.9
Wrote PEAR system config file at: /opt/php-7.2/etc/pear.conf
You may want to add: /opt/php-7.2/lib/php to your php.ini include_path
/usr/local/src/php7.2-build/php-7.2.25/build/shtool install -c ext/phar/phar.phar /opt/php-7.2/bin
ln -s -f phar.phar /opt/php-7.2/bin/phar
Installing PDO headers:           /opt/php-7.2/include/php/ext/pdo/

Fehler kann ignoriert werden –

PEAR package PHP_Archive not installed: generated phar will require PHP’s phar extension be enabled.

Den Pfad zur php.ini und LInk hinzufügen

# /usr/local/src/php7.2-build/php-7.2.25/build/shtool install -c ext/phar/phar.phar /opt/php-7.2/bin
# ln -s -f phar.phar /opt/php-7.2/bin/phar

Nun php.ini und php-fpm.conf kopieren:

Schritte sind bei PHP-Update nicht unbedingt notwendig.

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

Nun nachfolgende Optionen in der php-fpm.conf aktivieren

Schritte sind bei PHP-Update nicht unbedingt notwendig.

  1. # nano /opt/php-7.2/etc/php-fpm.conf
    1. pid = run/php-fpm.pid
    2. error_log=/var/log/php-fpm.log

PHP – freien Port (8998 oder 8999 oder 9000) einstellen

  1. benutzte(r) Port anzeigen: # netstat -tulpn |grep php-fpm
    tcp 0 0 127.0.0.1:9002 0.0.0.0:* LISTEN 1867/php-fpm.conf)
    tcp 0 0 127.0.0.1:9003 0.0.0.0:* LISTEN 1869/php-fpm.conf)
  2. neuen Port setzen: # nano /opt/php-7.2/etc/php-fpm.d/www.conf
    1. listen = 127.0.0.1:9004

Systemd Unit File erstellen

# nano /lib/systemd/system/php7.2-fpm.service

[Unit]
Description=The PHP 7.2 FastCGI Process Manager
After=network.target
[Service]
Type=simple
PIDFile=/opt/php-7.2/var/run/php-fpm.pid
ExecStart=/opt/php-7.2/sbin/php-fpm –-nodaemonize –-fpm-config /opt/php-7.2/etc/php-fpm.conf
ExecReload=/bin/kill -USR2 $MAINPID
[Install]
WantedBy=multi-user.target

Service aktivieren und Starten

# systemctl enable php7.2-fpm.service
# systemctl daemon-reload
# systemctl start php7.2-fpm.service

Status prüfen:

# systemctl status -l php7.2-fpm.service

Zend OPcache aktivieren

Schritte sind bei PHP-Update nicht unbedingt notwendig.

  1. nano /opt/php-7.2/lib/php.ini und am Ende folgendes hinzufügen: zend_extension=opcache.so
  2. PHP Version testen:
    1. # cd /opt/php-7.2/bin
    2. # ./php --version

Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.25, Copyright (c) 1999-2018, by Zend Technologies
with Xdebug v2.6.1, Copyright (c) 2002-2018, by Derick Rethans

Memcached aktivieren

Schritte sind bei PHP-Update nicht unbedingt notwendig.

Installieren: # apt-get install libmemcached-dev

nun in PHP 7.2 einbinden:

# mkdir /usr/local/src/php7.2-build/php-memcached
# cd /usr/local/src/php7.2-build/php-memcached
# wget http://pecl.php.net/get/memcached-3.1.4.tgz
# tar xzf memcached-3.1.4.tgz
# cd memcached-3.1.4
# /opt/php-7.2/bin/phpize
# ./configure --with-php-config=/opt/php-7.2/bin/php-config
# make
# make test
# make install

Memcached Extension in PHP 7.2 an das Ende hinzufügen
# nano /opt/php-7.2/lib/php.ini
extension=memcached.so

Memcached alternativ mittels PECL installieren

# pecl -C ./pear.conf channel-update pecl.php.net
# cd /opt/php-7.2/etc
# pecl -C ./pear.conf install memcached
pecl/memcached can optionally use PHP extension "igbinary" (version >= 2.0)
pecl/memcached can optionally use PHP extension "msgpack" (version >= 2.0)
downloading memcached-3.1.4.tgz ...
Starting to download memcached-3.1.4.tgz (82,920 bytes)
....................done: 82,920 bytes
15 source files, building
running: phpize
Configuring for:
PHP Api Version:         20170718
Zend Module Api No:      20170718
Zend Extension Api No:   320170718
libmemcached directory [no] : no 
zlib directory [no] : no
use system fastlz [no] : no
enable igbinary serializer [no] : no
enable msgpack serializer [no] : no
enable json serializer [no] : no
enable server protocol [no] : no
enable sasl [yes] : yes
enable sessions [yes] : yes
Build process completed successfully

Memcached Extension in PHP 7.2 an das Ende hinzufügen
# nano /opt/php-7.2/lib/php.ini
extension=memcached.so

Memcached überprüfen

# /opt/php-7.2/bin/php -i |grep -A2 -i "memcached support"
memcached support => enabled
Version => 3.1.4
libmemcached version => 1.0.18

xDebug aktivieren

Schritte sind bei PHP-Update nicht unbedingt notwendig.

# cd /opt/php-7.2/etc
# pecl -C ./pear.conf channel-update pecl.php.net
# pecl -C ./pear.conf install xdebug

Extension an das Ende hinzufügen:

# nano /opt/php-7.2/lib/php.ini
end_extension=/opt/php-7.2/lib/php/extensions/no-debug-non-zts-20170718/xdebug.so

# systemctl start php7.2-fpm.service
# systemctl status -l php7.2-fpm.service

PHP imagick installieren

# apt-get install libmagickwand-dev
# cd /opt/php-7.2/etc
# pecl -C ./pear.conf channel-update pecl.php.net
# pecl -C ./pear.conf install imagick
# Please provide the prefix of ImageMagick installation [autoconfig]: enter

PHP imagick Extension in PHP 7.2 an das Ende hinzufügen

# nano /opt/php-7.2/lib/php.ini
extension=imagick.so

# systemctl start php7.2-fpm.service
# systemctl status -l php7.2-fpm.service

PHP 7.2 in ISPConfig aktivieren

Schritte sind bei PHP-Update nicht notwendig.

Im Menü unter: unter Sysetm > Zusätzliche PHP Versionen (System > Additional PHP Versions) neue Version hinzufügen.

ISPConfig - weitere PHP Versionen
ISPConfig – weitere PHP Versionen

Dort im ersten Reiter “Name” ensprechend “PHP7.2” eintragen.

ISPConfig Add PHP 7.2 Name
ISPConfig Add PHP 7.2 Name

Im Reiter “FastCGI Settings” folgendes eintragen:

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

ISPConfig Add PHP 7.2 FastCGI Paths
ISPConfig Add PHP 7.2 FastCGI Paths

Nun im Reiter “PHP-FPM Settings” folgendes eintragen:

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

ISPConfig Add PHP 7.2 FPM Paths
ISPConfig Add PHP 7.2 FPM Paths

Abschließend die Konfiguration Speichern

aufräumen und Downloads löschen# rm /usr/local/src/php7.2-build


PHP 7.3 FastCGI und PHP-FPM installieren

# mkdir -p /opt/php-7.3
# mkdir /usr/local/src/php7.3-build
# cd /usr/local/src/php7.3-build
# wget http://de2.php.net/get/php-7.3.12.tar.bz2/from/this/mirror -O php-7.3.12.tar.bz2
# tar jxfv php-7.3.12.tar.bz2
# cd php-7.3.12

Fehler configure: error: Please reinstall the libzip distribution: # apt-get install libzip-dev

./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-intl --enable-fpm
# make
# make test
# make install
Installing shared extensions:     /opt/php-7.3/lib/php/extensions/no-debug-non-zts-20180731/
Installing PHP CLI binary:        /opt/php-7.3/bin/
Installing PHP CLI man page:      /opt/php-7.3/php/man/man1/
Installing PHP FPM binary:        /opt/php-7.3/sbin/
Installing PHP FPM defconfig:     skipping
Installing PHP FPM man page:      /opt/php-7.3/php/man/man8/
Installing PHP FPM status page:   /opt/php-7.3/php/php/fpm/
Installing phpdbg binary:         /opt/php-7.3/bin/
Installing phpdbg man page:       /opt/php-7.3/php/man/man1/
Installing PHP CGI binary:        /opt/php-7.3/bin/
Installing PHP CGI man page:      /opt/php-7.3/php/man/man1/
Installing build environment:     /opt/php-7.3/lib/php/build/
Installing header files:          /opt/php-7.3/include/php/
Installing helper programs:       /opt/php-7.3/bin/
  program: phpize
  program: php-config
Installing man pages:             /opt/php-7.3/php/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /opt/php-7.3/lib/php/
[PEAR] Archive_Tar    - already installed: 1.4.7
[PEAR] Console_Getopt - already installed: 1.4.2
[PEAR] Structures_Graph- already installed: 1.1.1
[PEAR] XML_Util       - already installed: 1.4.3
[PEAR] PEAR           - already installed: 1.10.9
You may want to add: /opt/php-7.3/lib/php to your php.ini include_path
/usr/local/src/php7.3-build/php-7.3.12/build/shtool install -c ext/phar/phar.phar /opt/php-7.3/bin
ln -s -f phar.phar /opt/php-7.3/bin/phar

PHP-Pfad zur php.ini und Link von phar hinzufügen

# /usr/local/src/php7.3-build/php-7.3.12/build/shtool install -c ext/phar/phar.phar /opt/php-7.3/bin
# ln -s -f phar.phar /opt/php-7.3/bin/phar

Nun php.ini und php-fpm.conf kopieren:

Schritte sind bei PHP-Update nicht unbedingt notwendig.

# cp /usr/local/src/php7.3-build/php-7.3.12/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

Nun nachfolgende Optionen in der php-fpm.conf aktivieren

  1. # nano /opt/php-7.3/etc/php-fpm.conf
    1. pid = run/php-fpm.pid
    2. error_log=/var/log/php-fpm.log

PHP – freien Port (8998 oder 8999 oder 9000) einstellen

  1. benutzte(r) Port anzeigen: # netstat -tulpn |grep php-fpm
    tcp 0 0 127.0.0.1:9002 0.0.0.0:* LISTEN 1867/php-fpm.conf)
    tcp 0 0 127.0.0.1:9003 0.0.0.0:* LISTEN 1869/php-fpm.conf)
  2. neuen Port setzen: # nano /opt/php-7.3/etc/php-fpm.d/www.conf
    1. listen = 127.0.0.1:9004

Systemd Unit File erstellen

# nano /lib/systemd/system/php7.3-fpm.service
[Unit]
Description=The PHP 7.3 FastCGI Process Manager
After=network.target

[Service]
Type=simple
PIDFile=/opt/php-7.3/var/run/php-fpm.pid
ExecStart=/opt/php-7.3/sbin/php-fpm –-nodaemonize –-fpm-config /opt/php-7.3/etc/php-fpm.conf
ExecReload=/bin/kill -USR2 $MAINPID

[Install]
WantedBy=multi-user.target

Service aktivieren und Starten

# systemctl enable php7.3-fpm.service
# systemctl daemon-reload
# systemctl start php7.3-fpm.service

Status prüfen:

# systemctl status -l php7.3-fpm.service

Zend OPcache aktivieren

Schritte sind bei PHP-Update nicht unbedingt notwendig.

  1. nano /opt/php-7.3/lib/php.ini und am Ende folgendes hinzufügen: zend_extension=opcache.so
  2. PHP Version testen:
    1. # cd /opt/php-7.3/bin
    2. # ./php --version

HP 7.3.12 (cli) (built: Nov 23 2019 22:50:16) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.12, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.12, Copyright (c) 1999-2018, by Zend Technologies

Memcached aktivieren

Schritte sind bei PHP-Update nicht unbedingt notwendig.

Installieren: # apt-get install libmemcached-dev

nun in PHP 7.3 einbinden:

# mkdir /usr/local/src/php7.3-build/php-memcached
# cd /usr/local/src/php7.3-build/php-memcached
# wget http://pecl.php.net/get/memcached-3.1.4.tgz
# tar xzf memcached-3.1.4.tgz
# cd memcached-3.1.4
# /opt/php-7.3/bin/phpize
# ./configure --with-php-config=/opt/php-7.3/bin/php-config
# make
# make test
# make install

Memcached Extension in PHP 7.3 an das Ende hinzufügen
# nano /opt/php-7.3/lib/php.ini
extension=memcached.so

Memcached alternativ mittels PECL installieren

# pecl -C ./pear.conf channel-update pecl.php.net
# cd /opt/php-7.3/etc
# pecl -C ./pear.conf install memcached
pecl/memcached can optionally use PHP extension "igbinary" (version >= 2.0)
pecl/memcached can optionally use PHP extension "msgpack" (version >= 2.0)
downloading memcached-3.1.4.tgz ...
Starting to download memcached-3.1.4.tgz (82,920 bytes)
....................done: 82,920 bytes
15 source files, building
running: phpize
Configuring for:
PHP Api Version:         20170718
Zend Module Api No:      20170718
Zend Extension Api No:   320170718
libmemcached directory [no] : no 
zlib directory [no] : no
use system fastlz [no] : no
enable igbinary serializer [no] : no
enable msgpack serializer [no] : no
enable json serializer [no] : no
enable server protocol [no] : no
enable sasl [yes] : yes
enable sessions [yes] : yes
Build process completed successfully

Memcached Extension in PHP 7.3 an das Ende hinzufügen
# nano /opt/php-7.3/lib/php.ini
extension=memcached.so

Memcached überprüfen

# /opt/php-7.3/bin/php -i |grep -A2 -i "memcached support"
memcached support => enabled
Version => 3.1.4
libmemcached version => 1.0.18

xDebug aktivieren

Schritte sind bei PHP-Update nicht unbedingt notwendig.

ACHTUNG xDebug scheint nur ohne opcache kompilierbar zu sein. Ein neues Release ist in Arbeit!!

# cd /opt/php-7.3/etc
# pecl -C ./pear.conf channel-update pecl.php.net
# pecl -C ./pear.conf install xdebug

Build process completed successfully
Installing '/opt/php-7.3/lib/php/extensions/no-debug-non-zts-20180731/xdebug.so'
install ok: channel://pecl.php.net/xdebug-2.8.0
configuration option "php_ini" is not set to php.ini location
You should add "zend_extension=/opt/php-7.3/lib/php/extensions/no-debug-non-zts-20180731/xdebug.so" to php.ini

Extension an das Ende hinzufügen:
# nano /opt/php-7.3/lib/php.ini
zend_extension=/opt/php-7.3/lib/php/extensions/no-debug-non-zts-20180731/xdebug.so
# systemctl start php7.3-fpm.service
# systemctl status -l php7.3-fpm.service

PHP imagick installieren

# apt-get install libmagickwand-dev
# cd /opt/php-7.3/etc
# pecl -C ./pear.conf channel-update pecl.php.net
# pecl -C ./pear.conf install imagick
# Please provide the prefix of ImageMagick installation [autoconfig]: enter

PHP imagick Extension in PHP 7.3 an das Ende hinzufügen
# nano /opt/php-7.3/lib/php.ini
extension=imagick.so

# systemctl start php7.3-fpm.service
# systemctl status -l php7.3-fpm.service

PHP 7.3 in ISPConfig aktivieren


Im Menü unter: unter Sysetm > Zusätzliche PHP Versionen (System > Additional PHP Versions) neue Version hinzufügen.

ISPConfig - weitere PHP Versionen
ISPConfig – weitere PHP Versionen

Dort im ersten Reiter “Name” ensprechend “PHP7.3” eintragen.

ISPConfig PHP 7.3 Name
ISPConfig PHP 7.3 Name

Im Reiter “FastCGI Settings” folgendes eintragen:

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

ISPConfig PHP 7.3 FastCGI
ISPConfig PHP 7.3 FastCGI

Nun im Reiter “PHP-FPM Settings” folgendes eintragen:

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

ISPConfig PHP 7.3 PHP-FPM
ISPConfig PHP 7.3 PHP-FPM

Abschließend die Konfiguration Speichern

aufräumen und Downloads löschen# rm /usr/local/src/php7.3-build

28 Kommentare

  1. Michael

    Hallo

    @Sören der Fehler Code (status=64) liegt im Startparameter https://freedesktop.org/software/systemd/man/systemd.exec.html#id-1.20.8.
    Das Problem an der Stelle ist nicht das der Parameter Falsch ist, sondern das beim Kopieren hier von der Seite des Codes
    die Formatierung die Ursache dafür ist.
    Ich hatte genau dasselbe Problem, bis ich einfach den code von https://www.howtoforge.com/tutorial/how-to-install-php-5.6-and-7.1-on-debian-9-stretch/ hier genommen habe mir direkt in der Datei angepasst und abgespeichert habe.
    Danach war es weg.
    MFG

    • JARVIS

      Hallo Michael,
      und vielen Dank für den Hinweis. Ich habe die Installation schon mehrfach mit Copy&Paste aus meinem Tutorial durchgeführt, es gab nie Probleme. Eine Kontrolle nach dem Einfügen kann jedoch nicht schaden :).

  2. Sven

    Nach Installtion von 7.3.8 erhielt ich nach systemctl status -l php-7.3-fpm.service die Fehlermeldung:
    Failed to map properties: Bad message
    Hm, leider sagt mir das gar nichts. Wo soll ich suchen?

  3. Martin

    Moin,
    vorab vielen Dank für diese Anleitung, leider lande ich auch im Fehler. Ich habe mir eben das Ergebnis vom make test angeschaut. Dieser lief nicht durch. Kann das eventuell die Ursache sein für das o.g. Problem?

    Ich selbst habe Debian 9.

    =====================================================================
    FAILED TEST SUMMARY
    ———————————————————————
    Bug #48182: ssl handshake fails during asynchronous socket connection [ext/openssl/tests/bug48182.phpt]
    Bug #54992: Stream not closed and error not returned when SSL CN_match fails [ext/openssl/tests/bug54992.phpt]
    Bug #65538: SSL context “cafile” supports stream wrappers [ext/openssl/tests/bug65538_001.phpt]
    Bug #65538: SSL context “cafile” supports phar wrapper [ext/openssl/tests/bug65538_003.phpt]
    Bug #74159: Writing a large buffer to non-blocking encrypted streams fails [ext/openssl/tests/bug74159.phpt]
    capture_peer_cert context captures on verify failure [ext/openssl/tests/capture_peer_cert_001.phpt]
    Testing peer fingerprint on connection [ext/openssl/tests/openssl_peer_fingerprint_basic.phpt]
    Peer verification enabled for client streams [ext/openssl/tests/peer_verification.phpt]
    Capture SSL session meta array in stream context [ext/openssl/tests/session_meta_capture.phpt]
    Basic bitwise stream crypto context flag assignment [ext/openssl/tests/stream_crypto_flags_001.phpt]
    TLSv1.1 and TLSv1.2 bitwise stream crypto flag assignment [ext/openssl/tests/stream_crypto_flags_002.phpt]
    Server bitwise stream crypto flag assignment [ext/openssl/tests/stream_crypto_flags_003.phpt]
    Specific protocol method specification [ext/openssl/tests/stream_crypto_flags_004.phpt]
    Allow host name mismatch when “verify_host” disabled [ext/openssl/tests/stream_verify_peer_name_002.phpt]
    Host name mismatch triggers error [ext/openssl/tests/stream_verify_peer_name_003.phpt]
    bool checkdnsrr ( string $host [, string $type = “MX” ] ); [ext/standard/tests/checkdnsrr.phpt]
    stream context tcp_nodelay fopen [ext/standard/tests/streams/stream_context_tcp_nodelay_fopen.phpt]
    =====================================================================

      • Martin

        Hallo,
        nackte Installation Debian 9, automatische Installation von ISPConfig 3.1
        Während der Installation wird man ja gefragt, ob man noch die PHP 5.6 Version installieren möchte, welches ich verneint habe. Also ist Default 7.0.

        Meines Erachtens ist die Version 7.1, die ich hinzufügen will, kein Update oder etwa doch?

        • JARVIS

          Hi,
          meine letzte Installation von ISP ist ne Weile her. Die automatische kannte ich bis eben gar nicht. Ich nehme wenn dann das “The Perfect Server – Deban ….” HowTo von Till Brehm. Datum ist auch neuer. Ich würde vorschlagen, sofern möglich, versuch dich mal daran und dann sollte es eigentlich klappen.

          • Martin

            Hi,
            also die Anleitung ebenfalls erfolgreich durchgearbeitet. Danach deine Anleitung Schritt für Schritt abgearbeitet, ohne Erfolg. Fehlermeldung bleibt die gleiche. Bin etwas mit meinem Latein am Ende.

  4. Sören

    Hi,

    danke für deine Hilfe! Es hat sich etwas verändert, es failed aber noch. Das ist nun die Rückgabe. Müsste es dann nicht auch –nodaemonize mit zwei Strichen sein? Wenn ja, dann bleibt es aber trotzdem bei der folgenden Rückgabe.

    # systemctl status -l php-7.2-fpm.service
    ● php-7.2-fpm.service – The PHP 7.2 FastCGI Process Manager
    Loaded: loaded (/lib/systemd/system/php-7.2-fpm.service; enabled; vendor preset: enabled)
    Active: failed (Result: exit-code) since Sun 2019-02-03 01:32:55 CET; 7s ago
    Process: 2135 ExecStart=/opt/php-7.2/sbin/php-fpm –nodaemonize –-fpm-config /opt/php-7.2/etc/php-fpm.conf (code=exited, status=203/EXEC)
    Main PID: 2135 (code=exited, status=203/EXEC)

  5. Sören

    Hallo,
    danke für die Anleitung. Ich habe es auf Ubuntu 16.04 versucht (PHP 7.2 und 7.3), schaffe es aber nicht den Dienst zum Laufen zu bringen. Beide Versionen scheitern beim Start und zeigen den folgenden Status. Habe gedacht es liegt an Zugriffsrechten für www-data auf den PID-Ordner, aber leider scheint es das nicht zu sein. Hat jemand einen Tipp für mich?

    php-7.2-fpm.service – The PHP 7.2 FastCGI Process Manager
    Loaded: loaded (/lib/systemd/system/php-7.2-fpm.service; enabled; vendor preset: enabled)
    Active: failed (Result: exit-code) since Sat 2019-02-02 19:44:42 CET; 8s ago
    Process: 22530 ExecStart=/opt/php-7.2/sbin/php-fpm –nodaemonize –fpm-config /opt/php-7.2/etc/php-fpm.conf (code=exited, status=64)
    Main PID: 22530 (code=exited, status=64)

    Viele Grüße,
    Sören

        • JARVIS

          Hi,
          ich bin eben die Konfig für die php-7.2-fpm.service durchgegangen und habe dort einen fehlenden Strich gefunden. Es ist korrigiert, der Part ist –> –-fpm-config <-- . Prüfe das bitte mal.

          • Sören

            Sorry, hatte eben nicht auf “Reply” geklickt. Stimmt nicht gan, was ich eben geschrieben hatte. Die Rückgabe bleibt gleich (status=64). Egal, ob mit einem oder zwei Strichen. Auch, wenn ich –nodaemonize — fpm-config verwende.

          • JARVIS

            Hi,
            ich bin nur auf Debian unterwegs, daher grade nicht im Bilde was Ubuntu angeht, was im Grunde ähnlich sein sollte, aber halt nur ähnlich. Konntest du alle benötigten Pakete installieren, oder gab es da einen Fehler? Ich könnte mir vorstellen, dass das ein oder andere in Ubuntu anders heißt. Wenn du Zeit hast, kann ich in den nächsten 2-3 Tagen, Ubuntu 16.4 aufsetzen und die Schritte durchgehen. Ansonsten gerne andere Anleitungen zu 16 und zusätzlicher PHP 7.2 Version suchen, wenn nicht bereits getan. Werde erst mal die Neuronen von JARVIS neu kalibrieren 🙂

          • Sören

            Einige Pakete hießen anders, aber das war kein Problem. Läuft soweit alles durch, bis auf eben an dieser Stelle. Ich bin schon dabei nach Informationen dazu zu suchen. Leider finde ich nichts zum “status=64”. Ich vermute, dass das PID-File nicht erstellt wird.

            Vielen Dank für deine Hilfe. Wenn es dir keine Mühe macht ein Ubuntu aufzusetzen… Ich erwarte soviel aber natürlich nicht von dir. Ich melde mich auf jeden Fall, wenn ich eine Lösung finden sollte.

          • JARVIS

            Hi,
            ok, hätte mich sonst auch gewundert. Hast du außer der Default Version, ich denke 7.0 ist es auch bei Ubuntu, oder?, noch eine PHP-Version installiert? Evtl. kannst du die PID-Datei mal nach der Version benennen: “pid = run/php-7.2-fpm.pid” Evtl. kollidiert meine Angabe mit einer anderen…

          • Sören

            Ja, ist auch 7.0 als default und die einzige installierte Version. Änderung des PID-Namens ändert leider auch nichts.

          • Sören

            Ich werde morgen {also heute 😉 eine Anleitung explizit für Ubuntu zu PHP 7.3 durchführen und dir Rückmeldung geben.

          • Sören

            Leider habe ich keinen Erfolg gehabt. Auch mit einer Ubuntu-Anleitung bekomme ich es nicht zum Laufen. Weiterhin “failed, status=64”. Hmm. Da muss ich wohl weiter suchen, was die Ursache sein könnte. Liegt wohl eher nicht an der Anleitung, sondern irgendwas auf dem Server passt da nicht.

          • Sören

            Moin,
            Ich schaue schon selbst, habe aber noch keine Lösung gefunden. Ich wäre natürlich dankbar für jeden Tipp, möchte aber von dir auch nicht verlangen soviel Aufwand für ein vermutlich individuelles Problem zu betreiben.

            Viele Grüße,
            Sören

          • JARVIS

            Hi,
            ok bin schon bei. Habe inzwischen einen Ubuntu Server 16.04 LTS installiert, ISPConfig 3 installiert und werde heute zztl. PHP 7.1 einrichten. Ist dein Ubuntu eigentlich mit 16.x installiert worden, oder war es ein Upgrade einer früheren Version? Falls es ein Upgrade war, könnte eine alte PHP5 Abhängigkeit ggf. zum Problem führen, aber das nur so als Idee.

          • Sören

            Argh. Wieder Reply vergessen. Sorry. Heute komme ich nicht mehr zum Testen. Der Server hat nichts besonderes. Alles Basis 16.04.

          • JARVIS

            Hi Sören,
            ich habe nun 2x PHP 7.1 installiert. Danach zeigt er mir bei der Testseite immer 404 und auf der Hauptseite, also eigentlich die Willkommensseite, nur Apache It works! Sehr eigenartig. Das Problem das du beschreibst habe ich jedoch gar nicht.

          • Sören

            Moin,

            Danke für deinen Test. Wie ich vermutet hatte ein lokales Problem. Ich werde es nochmal ausführlich testen und genau schauen, ob beim make irgendwas schief läuft. Kann ja nur etwas da sein, obwohl make test durchläuft. Sollte ich das Problem finden, schreibe ich hier dazu einen Kommentar.

            Viele Grüße,
            Sören

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert