{"id":4819,"date":"2020-02-03T23:36:52","date_gmt":"2020-02-04T02:36:52","guid":{"rendered":"https:\/\/blog.clusterweb.com.br\/?p=4819"},"modified":"2020-02-03T23:37:19","modified_gmt":"2020-02-04T02:37:19","slug":"how-to-install-php-7-3-on-debian-9-debian-8","status":"publish","type":"post","link":"https:\/\/blog.clusterweb.com.br\/?p=4819","title":{"rendered":"How To Install PHP 7.3 On Debian 9 \/ Debian 8"},"content":{"rendered":"<p>This short tutorial is for installing\u00a0PHP 7.3 on Debian 9 (Stretch) and Debian 8 (Jessie). With PHP 7.3\u00a0comes a number of bug fixes, new functionalities and features as well as a number of deprecations.<\/p>\n<p><!--more--><\/p>\n<p>For Ubuntu 18.04 \/ Ubuntu 16.04, use:<\/p>\n<h3>Install PHP 7.3 on Debian 9 \/ Debian 8<\/h3>\n<p>Follow the steps provided below to install\u00a07.3 on Debian 9 \/ Debian 8<\/p>\n<h3>Step 1: Update system and Install\u00a0add-apt-repository<\/h3>\n<p>Ensure your system is updated:<\/p>\n<pre class=\"wp-block-preformatted\">sudo apt update\r\nsudo apt upgrade -y<\/pre>\n<p>If you don\u2019t have add-apt-repository command available in your system, install it using our guide below:<\/p>\n<h3>Step 2: Add\u00a0 PHP 7.3 PPA repository<\/h3>\n<p>Once the\u00a0<code>add-apt-repository<\/code>\u00a0command is available, add PHP 7.3 PPA repository<\/p>\n<pre class=\"wp-block-preformatted\">sudo apt -y install lsb-release apt-transport-https ca-certificates \r\nsudo wget -O \/etc\/apt\/trusted.gpg.d\/php.gpg https:\/\/packages.sury.org\/php\/apt.gpg\r\necho \"deb https:\/\/packages.sury.org\/php\/ $(lsb_release -sc) main\" | sudo tee \/etc\/apt\/sources.list.d\/php7.3.list<\/pre>\n<h3>Step 3:\u00a0Install PHP 7.3 on Debian 9 \/ Debian 8<\/h3>\n<p>The last step is to\u00a0Install PHP 7.3 on Debian 9 \/ Debian 8. First, run the apt update command:<\/p>\n<pre class=\"wp-block-preformatted\">$ <strong>sudo apt update<\/strong>\r\n Hit:2 https:\/\/packages.sury.org\/php stretch InRelease\r\n Ign:1 https:\/\/cdn-fastly.deb.debian.org\/debian stretch InRelease\r\n Hit:3 https:\/\/cdn-fastly.deb.debian.org\/debian stretch Release\r\n Reading package lists\u2026 Done\r\n Building dependency tree \r\n Reading state information\u2026 Done\r\n 4 packages can be upgraded. Run 'apt list --upgradable' to see them.<\/pre>\n<p>Then install\u00a0 PHP 7.3 on Debian 9 \/ Debian 8:<\/p>\n<pre class=\"wp-block-preformatted\">sudo apt -y install php7.3<\/pre>\n<p>Check version installed<\/p>\n<pre class=\"wp-block-preformatted\">$ <strong>php -v<\/strong>\r\n PHP 7.3.0-2+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Dec 17 2018 09:22:47) ( NTS )\r\n Copyright (c) 1997-2018 The PHP Group\r\n Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies\r\n     with Zend OPcache v7.3.0-2+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies<\/pre>\n<h2>Step 4: Installing PHP 7.3 Extensions<\/h2>\n<p>Install PHP 7.3 extensions by using the syntax<\/p>\n<pre class=\"wp-block-preformatted\">\u00a0sudo apt install php7.3-&lt;entension-name&gt;<\/pre>\n<p>See example below which install standard PHP extensions.<\/p>\n<pre class=\"wp-block-preformatted\">sudo apt install php7.3-cli php7.3-fpm php7.3-json php7.3-pdo php7.3-mysql php7.3-zip php7.3-gd  php7.3-mbstring php7.3-curl php7.3-xml php7.3-bcmath php7.3-json<\/pre>\n<p>To install Apache Module for PHP, run:<\/p>\n<pre class=\"wp-block-preformatted\">sudo\u00a0apt install libapache2-mod-php7.3<\/pre>\n<p>Confirm one:<\/p>\n<pre class=\"wp-block-preformatted\"><strong>$ <\/strong>apt policy php7.3-cli\r\n php7.3-cli:\r\n   Installed: 7.3.0-2+ubuntu18.04.1+deb.sury.org+1\r\n   Candidate: 7.3.0-2+ubuntu18.04.1+deb.sury.org+1\r\n   Version table:\r\n  *** 7.3.0-2+ubuntu18.04.1+deb.sury.org+1 500\r\n         500 <a href=\"http:\/\/ppa.launchpad.net\/ondrej\/php\/ubuntu\">https:\/\/ppa.launchpad.net\/ondrej\/php\/ubuntu<\/a> bionic\/main amd64 Packages\r\n         100 \/var\/lib\/dpkg\/status<\/pre>\n<p>Congratulations!!. You have successfully installed\u00a0PHP 7.3 on Debian 9 \/ Debian 8.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This short tutorial is for installing\u00a0PHP 7.3 on Debian 9 (Stretch) and Debian 8 (Jessie). With PHP 7.3\u00a0comes a number of bug fixes, new functionalities and features as well as a number of deprecations.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[455,1,730,830,725,42,51,495,548],"tags":[1440,1134,1441,17,920,291,923,132,921],"class_list":["post-4819","post","type-post","status-publish","format-standard","hentry","category-apache2","category-viazap","category-clusterweb","category-debian","category-hospedagem","category-leitura-recomendada","category-linux-linuxrs","category-profissional-de-ti","category-ubuntu-2","tag-7-3","tag-1134","tag-1441","tag-debian","tag-how","tag-install","tag-on","tag-php","tag-to"],"_links":{"self":[{"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/posts\/4819","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4819"}],"version-history":[{"count":2,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/posts\/4819\/revisions"}],"predecessor-version":[{"id":4821,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/posts\/4819\/revisions\/4821"}],"wp:attachment":[{"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4819"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4819"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}