В этой статье рассмотрим, как установить последнюю версию PHP 7.3, (а не стандартную php 7.0), на сервер с ОС Debian 9, сконфигурированный работать в качестве web-сервера в связке NGiNX + Apache. Данная информация не относится собственно к программированию на PHP, а скорее связана с правильной настройкой сервера и его обслуживанием. Установка PHP7.3 в данной статье рассматривается на работающем сервере с уже установленными NGiNX и Apache.
Предварительная подготовка к установке PHP 7.3 на сервер
Стандартные процедуры обновления списка пакетов:
root@server:~# apt update
и накатывание обновлений, если они найдутся
root@server:~# apt upgrade -y
разница лишь в том, что название установщика не apt-get
, а просто apt
. Ну и апгрейд осуществляется с опцией -y
, чтобы не отвечать согласием на установку найденных обновлений.
Список php-пакетов, готовых к установку в систему
Посмотрим, какие php-пакеты есть 7-й версии для установки:
root@server:~# apt-cache search php7
php-amqp - AMQP extension for PHP
php-apcu - APC User Cache for PHP
php-all-dev - package depending on all supported PHP development packages
php-gearman - PHP wrapper to libgearman
php-geoip - GeoIP module for PHP
php-gmagick - Provides a wrapper to the GraphicsMagick library
php-gnupg - PHP wrapper around the gpgme library
php-igbinary - igbinary PHP serializer
php-imagick - Provides a wrapper to the ImageMagick library
php-libsodium - PHP wrapper for the Sodium cryptographic library
php-mailparse - Email message manipulation for PHP
php-memcache - memcache extension module for PHP
php-memcached - memcached extension module for PHP, uses libmemcached
php-mongodb - MongoDB driver for PHP
php-msgpack - PHP extension for interfacing with MessagePack
php-oauth - OAuth 1.0 consumer and provider extension
php-http - PECL HTTP module for PHP Extended HTTP Support
php-pinba - Pinba module for PHP
php-propro - propro module for PHP
php-radius - radius client library for PHP
php-raphf - raphf module for PHP
php-redis - PHP extension for interfacing with Redis
php-rrd - PHP bindings to rrd tool system
php-smbclient - PHP wrapper for libsmbclient
php-solr - PHP extension for communicating with Apache Solr server
php-ssh2 - Bindings for the libssh2 library
php-stomp - Streaming Text Oriented Messaging Protocol (STOMP) client module for PHP
php-symfony-polyfill-php70 - Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions
php-uploadprogress - file upload progress tracking extension for PHP
php-uuid - PHP UUID extension
php-yac - YAC (Yet Another Cache) for PHP
php-yaml - YAML-1.1 parser and emitter for PHP
php-zmq - ZeroMQ messaging bindings for PHP
libapache2-mod-php7.0 - server-side, HTML-embedded scripting language (Apache 2 module)
libphp7.0-embed - HTML-embedded scripting language (Embedded SAPI library)
php7.0 - server-side, HTML-embedded scripting language (metapackage)
php7.0-bcmath - Bcmath module for PHP
php7.0-bz2 - bzip2 module for PHP
php7.0-cgi - server-side, HTML-embedded scripting language (CGI binary)
php7.0-cli - command-line interpreter for the PHP scripting language
php7.0-common - documentation, examples and common module for PHP
php7.0-curl - CURL module for PHP
php7.0-dba - DBA module for PHP
php7.0-dev - Files for PHP7.0 module development
php7.0-enchant - Enchant module for PHP
php7.0-fpm - server-side, HTML-embedded scripting language (FPM-CGI binary)
php7.0-gd - GD module for PHP
php7.0-gmp - GMP module for PHP
php7.0-imap - IMAP module for PHP
php7.0-interbase - Interbase module for PHP
php7.0-intl - Internationalisation module for PHP
php7.0-json - JSON module for PHP
php7.0-ldap - LDAP module for PHP
php7.0-mbstring - MBSTRING module for PHP
php7.0-mcrypt - libmcrypt module for PHP
php7.0-mysql - MySQL module for PHP
php7.0-odbc - ODBC module for PHP
php7.0-opcache - Zend OpCache module for PHP
php7.0-pgsql - PostgreSQL module for PHP
php7.0-phpdbg - server-side, HTML-embedded scripting language (PHPDBG binary)
php7.0-pspell - pspell module for PHP
php7.0-readline - readline module for PHP
php7.0-recode - recode module for PHP
php7.0-snmp - SNMP module for PHP
php7.0-soap - SOAP module for PHP
php7.0-sqlite3 - SQLite3 module for PHP
php7.0-sybase - Sybase module for PHP
php7.0-tidy - tidy module for PHP
php7.0-xml - DOM, SimpleXML, WDDX, XML, and XSL module for PHP
php7.0-xmlrpc - XMLRPC-EPI module for PHP
php7.0-xsl - XSL module for PHP (dummy)
php7.0-zip - Zip module for PHP
php7cc - command line tool to detect PHP 7 incompatible code
php-remctl - PECL module for Kerberos-authenticated command execution
php-tideways - Tideways PHP Profiler Extension
php-xdebug - Xdebug Module for PHP
Какие угодно, но всё стандартной для текущего состояния Debian 9 версии 7.0... А хочется последнюю версию 7.3 php. Ну что же...
Добавляем PPA репозиторий для PHP 7.3
Сперва добавим три пакета для работы для поддержки работы по протоколу https, соотверственно, с CA-сертификатами и библиотеку lsb-release. При установке использована опция -y
. Если её отключить, при инсталляции этих пакетов сперва будет выдана информация по ним и, для их установки, потребуется подтвердить своё согласие... А так — всё на полном автомате:
root@server:~# apt -y install lsb-release apt-transport-https ca-certificates
Reading package lists... Done
Building dependency tree
Reading state information... Done
ca-certificates is already the newest version (20161130+nmu1+deb9u1).
ca-certificates set to manually installed.
lsb-release is already the newest version (9.20161125).
lsb-release set to manually installed.
The following NEW packages will be installed:
apt-transport-https
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 171 kB of archives.
After this operation, 243 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian stretch/main amd64 apt-transport-https amd64 1.4.9 [171 kB]
Fetched 171 kB in 0s (567 kB/s)
Selecting previously unselected package apt-transport-https.
(Reading database ... 29857 files and directories currently installed.)
Preparing to unpack .../apt-transport-https_1.4.9_amd64.deb ...
Unpacking apt-transport-https (1.4.9) ...
Setting up apt-transport-https (1.4.9) ...
Добавим к списку серверов с репозиториями ещё один для стабильной версии PHP 7.3
root@server:~# wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
--2019-05-04 20:04:28-- https://packages.sury.org/php/apt.gpg
Resolving packages.sury.org (packages.sury.org)... 104.31.94.169, 104.31.95.169, 2606:4700:30::681f:5fa9, ...
Connecting to packages.sury.org (packages.sury.org)|104.31.94.169|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1769 (1.7K) [application/octet-stream]
Saving to: ‘/etc/apt/trusted.gpg.d/php.gpg’
/etc/apt/trusted.gpg.d/php.gpg 100%[====================================================================================>] 1.73K --.-KB/s in 0s
2019-05-04 20:04:28 (19.3 MB/s) - ‘/etc/apt/trusted.gpg.d/php.gpg’ saved [1769/1769]
root@server:~# echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php7.3.list
deb https://packages.sury.org/php/ stretch main
И снова обновим список пакетов репозиториев:
root@server:~# apt update
Ign:1 http://deb.debian.org/debian stretch InRelease
Hit:2 http://security.debian.org/debian-security stretch/updates InRelease
Hit:3 http://deb.debian.org/debian stretch-updates InRelease
Hit:4 http://nginx.org/packages/mainline/debian stretch InRelease
Hit:5 http://deb.debian.org/debian stretch Release
Get:6 https://packages.sury.org/php stretch InRelease [6,760 B]
Get:8 https://packages.sury.org/php stretch/main amd64 Packages [112 kB]
Fetched 119 kB in 1s (96.1 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
4 packages can be upgraded. Run 'apt list --upgradable' to see them.
Как видно, появился дополнительный сервер https://packages.sury.org/php
и четыре пакета требуют обновлений. Обновляемся:
root@server:~# apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
libpcre3 libssl1.1 openssl python3-httplib2
4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 2,716 kB of archives.
After this operation, 531 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Do you want to continue? [Y/n] Y
Get:1 https://packages.sury.org/php stretch/main amd64 libpcre3 amd64 2:8.42-1+0~20190203125157.5+stretch~1.gbp79d75d [338 kB]
Get:2 https://packages.sury.org/php stretch/main amd64 libssl1.1 amd64 1.1.1b-1+0~20190228092419.10+stretch~1.gbp729d89 [1,520 kB]
Get:3 https://packages.sury.org/php stretch/main amd64 openssl amd64 1.1.1b-1+0~20190228092419.10+stretch~1.gbp729d89 [829 kB]
Get:4 https://packages.sury.org/php stretch/main amd64 python3-httplib2 all 0.11.3-1+0~20190212170628.3+stretch~1.gbp2efb8a [29.0 kB]
Fetched 2,716 kB in 1s (1,682 kB/s)
Reading changelogs... Done
Preconfiguring packages ...
(Reading database ... 29877 files and directories currently installed.)
Preparing to unpack .../libpcre3_2%3a8.42-1+0~20190203125157.5+stretch~1.gbp79d75d_amd64.deb ...
Unpacking libpcre3:amd64 (2:8.42-1+0~20190203125157.5+stretch~1.gbp79d75d) over (2:8.39-3) ...
Setting up libpcre3:amd64 (2:8.42-1+0~20190203125157.5+stretch~1.gbp79d75d) ...
(Reading database ... 29877 files and directories currently installed.)
Preparing to unpack .../libssl1.1_1.1.1b-1+0~20190228092419.10+stretch~1.gbp729d89_amd64.deb ...
Unpacking libssl1.1:amd64 (1.1.1b-1+0~20190228092419.10+stretch~1.gbp729d89) over (1.1.0j-1~deb9u1) ...
Preparing to unpack .../openssl_1.1.1b-1+0~20190228092419.10+stretch~1.gbp729d89_amd64.deb ...
Unpacking openssl (1.1.1b-1+0~20190228092419.10+stretch~1.gbp729d89) over (1.1.0j-1~deb9u1) ...
Preparing to unpack .../python3-httplib2_0.11.3-1+0~20190212170628.3+stretch~1.gbp2efb8a_all.deb ...
Unpacking python3-httplib2 (0.11.3-1+0~20190212170628.3+stretch~1.gbp2efb8a) over (0.9.2+dfsg-1) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Setting up libssl1.1:amd64 (1.1.1b-1+0~20190228092419.10+stretch~1.gbp729d89) ...
Setting up python3-httplib2 (0.11.3-1+0~20190212170628.3+stretch~1.gbp2efb8a) ...
Setting up openssl (1.1.1b-1+0~20190228092419.10+stretch~1.gbp729d89) ...
Installing new version of config file /etc/ssl/openssl.cnf ...
Processing triggers for man-db (2.7.6.1-2) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Список php-пакетов версии 7.3, готовых к установку в систему
И ещё раз проверим, появились ли php-пакеты версии 7.3, которые мы собственно намерены установить в систему:
root@server:~# apt-cache search php7.3
php-amqp - AMQP extension for PHP
php-apcu - APC User Cache for PHP
php-apcu-bc - APCu Backwards Compatibility Module
php-gearman - PHP wrapper to libgearman
php-geoip - GeoIP module for PHP
php-gmagick - Provides a wrapper to the GraphicsMagick library
php-igbinary - igbinary PHP serializer
php-imagick - Provides a wrapper to the ImageMagick library
php-mailparse - Email message manipulation for PHP
php-memcached - memcached extension module for PHP, uses libmemcached
php-mongodb - MongoDB driver for PHP
php-msgpack - PHP extension for interfacing with MessagePack
php-oauth - OAuth 1.0 consumer and provider extension
php-http - PECL HTTP module for PHP Extended HTTP Support
php-propro - propro module for PHP
php-radius - radius client library for PHP
php-raphf - raphf module for PHP
php-redis - PHP extension for interfacing with Redis
php-rrd - PHP bindings to rrd tool system
php-smbclient - PHP wrapper for libsmbclient
php-solr - PHP extension for communicating with Apache Solr server
php-ssh2 - Bindings for the libssh2 library
php-stomp - Streaming Text Oriented Messaging Protocol (STOMP) client module for PHP
php-uploadprogress - file upload progress tracking extension for PHP
php-uuid - PHP UUID extension
php-yac - YAC (Yet Another Cache) for PHP
php-yaml - YAML-1.1 parser and emitter for PHP
php-zmq - ZeroMQ messaging bindings for PHP
php-tideways - Tideways PHP Profiler Extension
php-xdebug - Xdebug Module for PHP
libapache2-mod-php7.3 - server-side, HTML-embedded scripting language (Apache 2 module)
libapache2-mod-php7.3-dbgsym - debug symbols for libapache2-mod-php7.3
libphp7.3-embed - HTML-embedded scripting language (Embedded SAPI library)
libphp7.3-embed-dbgsym - debug symbols for libphp7.3-embed
php-ds - PHP extension providing efficient data structures for PHP 7
php-lua - PHP Embedded lua interpreter
php-phalcon - full-stack PHP framework delivered as a C-extension
php7.3 - server-side, HTML-embedded scripting language (metapackage)
php7.3-bcmath - Bcmath module for PHP
php7.3-bcmath-dbgsym - debug symbols for php7.3-bcmath
php7.3-bz2 - bzip2 module for PHP
php7.3-bz2-dbgsym - debug symbols for php7.3-bz2
php7.3-cgi - server-side, HTML-embedded scripting language (CGI binary)
php7.3-cgi-dbgsym - debug symbols for php7.3-cgi
php7.3-cli - command-line interpreter for the PHP scripting language
php7.3-cli-dbgsym - debug symbols for php7.3-cli
php7.3-common - documentation, examples and common module for PHP
php7.3-common-dbgsym - debug symbols for php7.3-common
php7.3-curl - CURL module for PHP
php7.3-curl-dbgsym - debug symbols for php7.3-curl
php7.3-dba - DBA module for PHP
php7.3-dba-dbgsym - debug symbols for php7.3-dba
php7.3-dev - Files for PHP7.3 module development
php7.3-enchant - Enchant module for PHP
php7.3-enchant-dbgsym - debug symbols for php7.3-enchant
php7.3-fpm - server-side, HTML-embedded scripting language (FPM-CGI binary)
php7.3-fpm-dbgsym - debug symbols for php7.3-fpm
php7.3-gd - GD module for PHP
php7.3-gd-dbgsym - debug symbols for php7.3-gd
php7.3-gmp - GMP module for PHP
php7.3-gmp-dbgsym - debug symbols for php7.3-gmp
php7.3-imap - IMAP module for PHP
php7.3-imap-dbgsym - debug symbols for php7.3-imap
php7.3-interbase - Interbase module for PHP
php7.3-interbase-dbgsym - debug symbols for php7.3-interbase
php7.3-intl - Internationalisation module for PHP
php7.3-intl-dbgsym - debug symbols for php7.3-intl
php7.3-json - JSON module for PHP
php7.3-json-dbgsym - debug symbols for php7.3-json
php7.3-ldap - LDAP module for PHP
php7.3-ldap-dbgsym - debug symbols for php7.3-ldap
php7.3-mbstring - MBSTRING module for PHP
php7.3-mbstring-dbgsym - debug symbols for php7.3-mbstring
php7.3-mysql - MySQL module for PHP
php7.3-mysql-dbgsym - debug symbols for php7.3-mysql
php7.3-odbc - ODBC module for PHP
php7.3-odbc-dbgsym - debug symbols for php7.3-odbc
php7.3-opcache - Zend OpCache module for PHP
php7.3-opcache-dbgsym - debug symbols for php7.3-opcache
php7.3-pgsql - PostgreSQL module for PHP
php7.3-pgsql-dbgsym - debug symbols for php7.3-pgsql
php7.3-phpdbg - server-side, HTML-embedded scripting language (PHPDBG binary)
php7.3-phpdbg-dbgsym - debug symbols for php7.3-phpdbg
php7.3-pspell - pspell module for PHP
php7.3-pspell-dbgsym - debug symbols for php7.3-pspell
php7.3-readline - readline module for PHP
php7.3-readline-dbgsym - debug symbols for php7.3-readline
php7.3-recode - recode module for PHP
php7.3-recode-dbgsym - debug symbols for php7.3-recode
php7.3-snmp - SNMP module for PHP
php7.3-snmp-dbgsym - debug symbols for php7.3-snmp
php7.3-soap - SOAP module for PHP
php7.3-soap-dbgsym - debug symbols for php7.3-soap
php7.3-sqlite3 - SQLite3 module for PHP
php7.3-sqlite3-dbgsym - debug symbols for php7.3-sqlite3
php7.3-sybase - Sybase module for PHP
php7.3-sybase-dbgsym - debug symbols for php7.3-sybase
php7.3-tidy - tidy module for PHP
php7.3-tidy-dbgsym - debug symbols for php7.3-tidy
php7.3-xml - DOM, SimpleXML, WDDX, XML, and XSL module for PHP
php7.3-xml-dbgsym - debug symbols for php7.3-xml
php7.3-xmlrpc - XMLRPC-EPI module for PHP
php7.3-xmlrpc-dbgsym - debug symbols for php7.3-xmlrpc
php7.3-xsl - XSL module for PHP (dummy)
php7.3-zip - Zip module for PHP
php7.3-zip-dbgsym - debug symbols for php7.3-zip
О! Да! Появились! =)
Устанавливаем PHP 7.3 в Debian 9
Теперь можно и PHP 7.3 установить. Я не буду ставить сразу всё, установлю лишь базовый пакет. Остальные буду добавлять по мере необходимости. Они могут потребоваться для полноценной работы phpMyAdmin и Joomla (мне только для этого, в будущем, для Yii 2.0). Кому-то, возможно потребуются пакеты ещё для чего-то. Но, чтобы не собирать ненужный мусор, пока только базовый пакет, который собирается установить ещё дополнительные пакеты, нужные ему для работы:
root@server:~# apt install php7.3
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libapache2-mod-php7.3 libargon2-1 libpcre2-8-0 libsodium23 php-common php7.3-cli php7.3-common php7.3-json php7.3-opcache php7.3-readline psmisc
Suggested packages:
php-pear
The following NEW packages will be installed:
libapache2-mod-php7.3 libargon2-1 libpcre2-8-0 libsodium23 php-common php7.3 php7.3-cli php7.3-common php7.3-json php7.3-opcache php7.3-readline psmisc
0 upgraded, 12 newly installed, 0 to remove and 4 not upgraded.
Need to get 4,014 kB of archives.
After this operation, 18.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Соглашаемся с установкой Y
и нажимаем Enter
:
Do you want to continue? [Y/n] Y
Get:1 http://deb.debian.org/debian stretch/main amd64 psmisc amd64 22.21-2.1+b2 [123 kB]
Get:2 https://packages.sury.org/php stretch/main amd64 php-common all 2:69+0~20190303094804.15+stretch~1.gbp0f7465 [15.2 kB]
Get:3 https://packages.sury.org/php stretch/main amd64 php7.3-common amd64 7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b [559 kB]
Get:4 https://packages.sury.org/php stretch/main amd64 php7.3-json amd64 7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b [18.1 kB]
Get:5 https://packages.sury.org/php stretch/main amd64 php7.3-opcache amd64 7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b [177 kB]
Get:6 https://packages.sury.org/php stretch/main amd64 php7.3-readline amd64 7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b [11.7 kB]
Get:7 https://packages.sury.org/php stretch/main amd64 libargon2-1 amd64 0~20171227-1~20190119054414.2+stretch [21.1 kB]
Get:8 https://packages.sury.org/php stretch/main amd64 libpcre2-8-0 amd64 10.32-4+0~20190202200700.3+stretch~1.gbpd4ef41 [210 kB]
Get:9 https://packages.sury.org/php stretch/main amd64 libsodium23 amd64 1.0.17-0.1+0~20190131101845.5+stretch~1.gbp8cf594 [157 kB]
Get:10 https://packages.sury.org/php stretch/main amd64 php7.3-cli amd64 7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b [1,371 kB]
Get:11 https://packages.sury.org/php stretch/main amd64 libapache2-mod-php7.3 amd64 7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b [1,316 kB]
Get:12 https://packages.sury.org/php stretch/main amd64 php7.3 all 7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b [35.8 kB]
Fetched 4,014 kB in 2s (1,993 kB/s)
Selecting previously unselected package psmisc.
(Reading database ... 29863 files and directories currently installed.)
Preparing to unpack .../00-psmisc_22.21-2.1+b2_amd64.deb ...
Unpacking psmisc (22.21-2.1+b2) ...
Selecting previously unselected package php-common.
Preparing to unpack .../01-php-common_2%3a69+0~20190303094804.15+stretch~1.gbp0f7465_all.deb ...
Unpacking php-common (2:69+0~20190303094804.15+stretch~1.gbp0f7465) ...
Selecting previously unselected package php7.3-common.
Preparing to unpack .../02-php7.3-common_7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b_amd64.deb ...
Unpacking php7.3-common (7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b) ...
Selecting previously unselected package php7.3-json.
Preparing to unpack .../03-php7.3-json_7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b_amd64.deb ...
Unpacking php7.3-json (7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b) ...
Selecting previously unselected package php7.3-opcache.
Preparing to unpack .../04-php7.3-opcache_7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b_amd64.deb ...
Unpacking php7.3-opcache (7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b) ...
Selecting previously unselected package php7.3-readline.
Preparing to unpack .../05-php7.3-readline_7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b_amd64.deb ...
Unpacking php7.3-readline (7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b) ...
Selecting previously unselected package libargon2-1:amd64.
Preparing to unpack .../06-libargon2-1_0~20171227-1~20190119054414.2+stretch_amd64.deb ...
Unpacking libargon2-1:amd64 (0~20171227-1~20190119054414.2+stretch) ...
Selecting previously unselected package libpcre2-8-0:amd64.
Preparing to unpack .../07-libpcre2-8-0_10.32-4+0~20190202200700.3+stretch~1.gbpd4ef41_amd64.deb ...
Unpacking libpcre2-8-0:amd64 (10.32-4+0~20190202200700.3+stretch~1.gbpd4ef41) ...
Selecting previously unselected package libsodium23:amd64.
Preparing to unpack .../08-libsodium23_1.0.17-0.1+0~20190131101845.5+stretch~1.gbp8cf594_amd64.deb ...
Unpacking libsodium23:amd64 (1.0.17-0.1+0~20190131101845.5+stretch~1.gbp8cf594) ...
Selecting previously unselected package php7.3-cli.
Preparing to unpack .../09-php7.3-cli_7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b_amd64.deb ...
Unpacking php7.3-cli (7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b) ...
Selecting previously unselected package libapache2-mod-php7.3.
Preparing to unpack .../10-libapache2-mod-php7.3_7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b_amd64.deb ...
Unpacking libapache2-mod-php7.3 (7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b) ...
Selecting previously unselected package php7.3.
Preparing to unpack .../11-php7.3_7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b_all.deb ...
Unpacking php7.3 (7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b) ...
Setting up psmisc (22.21-2.1+b2) ...
Setting up libsodium23:amd64 (1.0.17-0.1+0~20190131101845.5+stretch~1.gbp8cf594) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Setting up php-common (2:69+0~20190303094804.15+stretch~1.gbp0f7465) ...
Created symlink /etc/systemd/system/timers.target.wants/phpsessionclean.timer → /lib/systemd/system/phpsessionclean.timer.
Processing triggers for man-db (2.7.6.1-2) ...
Setting up libargon2-1:amd64 (0~20171227-1~20190119054414.2+stretch) ...
Setting up libpcre2-8-0:amd64 (10.32-4+0~20190202200700.3+stretch~1.gbpd4ef41) ...
Setting up php7.3-common (7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b) ...
Creating config file /etc/php/7.3/mods-available/calendar.ini with new version
Creating config file /etc/php/7.3/mods-available/ctype.ini with new version
Creating config file /etc/php/7.3/mods-available/exif.ini with new version
Creating config file /etc/php/7.3/mods-available/fileinfo.ini with new version
Creating config file /etc/php/7.3/mods-available/ftp.ini with new version
Creating config file /etc/php/7.3/mods-available/gettext.ini with new version
Creating config file /etc/php/7.3/mods-available/iconv.ini with new version
Creating config file /etc/php/7.3/mods-available/pdo.ini with new version
Creating config file /etc/php/7.3/mods-available/phar.ini with new version
Creating config file /etc/php/7.3/mods-available/posix.ini with new version
Creating config file /etc/php/7.3/mods-available/shmop.ini with new version
Creating config file /etc/php/7.3/mods-available/sockets.ini with new version
Creating config file /etc/php/7.3/mods-available/sysvmsg.ini with new version
Creating config file /etc/php/7.3/mods-available/sysvsem.ini with new version
Creating config file /etc/php/7.3/mods-available/sysvshm.ini with new version
Creating config file /etc/php/7.3/mods-available/tokenizer.ini with new version
Setting up php7.3-opcache (7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b) ...
Creating config file /etc/php/7.3/mods-available/opcache.ini with new version
Setting up php7.3-readline (7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b) ...
Creating config file /etc/php/7.3/mods-available/readline.ini with new version
Setting up php7.3-json (7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b) ...
Creating config file /etc/php/7.3/mods-available/json.ini with new version
Setting up php7.3-cli (7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b) ...
update-alternatives: using /usr/bin/php7.3 to provide /usr/bin/php (php) in auto mode
update-alternatives: using /usr/bin/phar7.3 to provide /usr/bin/phar (phar) in auto mode
update-alternatives: using /usr/bin/phar.phar7.3 to provide /usr/bin/phar.phar (phar.phar) in auto mode
Creating config file /etc/php/7.3/cli/php.ini with new version
Setting up libapache2-mod-php7.3 (7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b) ...
Creating config file /etc/php/7.3/apache2/php.ini with new version
apache2_invoke: Enable module php7.3
Setting up php7.3 (7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Дожидаемся окончания установки, и php7.3 благополучно установлен! =)
Проверка установленной версии php
Проверим, что установилось:
root@server:~# php -v
PHP 7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b (cli) (built: May 3 2019 09:38:28) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.5, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b, Copyright (c) 1999-2018, by Zend Technologies
Судя по всему действительно php7.3 =)
Проверка работы PHP 7.3 на сервере
Перезагрузим Apache
root@server:~# systemctl restart apache2
Создадим простой php-скрипт в файле test.php
:
root@server:~# echo -e "<?php\nphpinfo();\n?>" > /var/www/html/test.php
Для ясности. В этом файле следующее содержимое:
<?php
phpinfo();
?>
Ну и запустим этот скрипт в браузере.
http://server-domain-or-ip:8080/test.php
Так как виртуальные хосты ещё не настроены, а Apache уже слушает порт 8080, то такой вот вызов =)
Но всё работает и в браузере отображается вывод php-функции phpinfo()
. Если всё работает, удаляем проверочный файл:
root@server:~# rm /var/www/html/test.php
Резюме
Дальше можно устанавливать phpMyAdmin и доводить до ума настройку виртуальных хостов на сервере.
Заберите ссылку на статью к себе, чтобы потом легко её найти!
Раз уж досюда дочитали, то может может есть желание рассказать об этом месте своим друзьям, знакомым и просто мимо проходящим?
Не надо себя сдерживать! ;)