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.
# nano /opt/php-7.1/etc/php-fpm.conf
- pid = run/php-fpm.pid
- error_log=/var/log/php-fpm.log
PHP – freien Port (8998 oder 8999 oder 9000) einstellen
- 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) - neuen Port setzen: #
nano /opt/php-7.1/etc/php-fpm.d/www.conf
- 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.
nano /opt/php-7.1/lib/php.ini
und am Ende folgendes hinzufügen: zend_extension=opcache.so- PHP Version testen:
# cd /opt/php-7.1/bin
# ./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.
Dort im ersten Reiter “Name” ensprechend “PHP7.1” eintragen.
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
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
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.
# nano /opt/php-7.2/etc/php-fpm.conf
- pid = run/php-fpm.pid
- error_log=/var/log/php-fpm.log
PHP – freien Port (8998 oder 8999 oder 9000) einstellen
- 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) - neuen Port setzen: #
nano /opt/php-7.2/etc/php-fpm.d/www.conf
- 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.
nano /opt/php-7.2/lib/php.ini
und am Ende folgendes hinzufügen: zend_extension=opcache.so- PHP Version testen:
# cd /opt/php-7.2/bin
# ./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.
Dort im ersten Reiter “Name” ensprechend “PHP7.2” eintragen.
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
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
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
- Support für mcrypt ist seit 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 seit PHP 7.2 entfernt
--enable-gd-native-ttf
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
# nano /opt/php-7.3/etc/php-fpm.conf
- pid = run/php-fpm.pid
- error_log=/var/log/php-fpm.log
PHP – freien Port (8998 oder 8999 oder 9000) einstellen
- 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) - neuen Port setzen: #
nano /opt/php-7.3/etc/php-fpm.d/www.conf
- 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.
nano /opt/php-7.3/lib/php.ini
und am Ende folgendes hinzufügen: zend_extension=opcache.so- PHP Version testen:
# cd /opt/php-7.3/bin
# ./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.
Dort im ersten Reiter “Name” ensprechend “PHP7.3” eintragen.
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
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
Abschließend die Konfiguration Speichern
aufräumen und Downloads löschen# rm /usr/local/src/php7.3-build
Interessiert in verschiedenste IT Themen, schreibe ich in diesem Blog über Software, Hardware, Smart Home, Games und vieles mehr. Ich berichte z.B. über die Installation und Konfiguration von Software als auch von Problemen mit dieser. News sind ebenso spannend, sodass ich auch über Updates, Releases und Neuigkeiten aus der IT berichte. Letztendlich nutze ich Taste-of-IT als eigene Dokumentation und Anlaufstelle bei wiederkehrenden Themen. Ich hoffe ich kann dich ebenso informieren und bei Problemen eine schnelle Lösung anbieten. Wer meinen Aufwand unterstützen möchte, kann gerne eine Tasse oder Pod Kaffe per PayPal spenden – vielen Dank.