{"id":27881,"date":"2018-08-21T04:01:39","date_gmt":"2018-08-21T09:01:39","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=27881"},"modified":"2022-12-12T07:23:27","modified_gmt":"2022-12-12T13:23:27","slug":"how-to-install-php-7-2-on-ubuntu-16-04","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/","title":{"rendered":"How to Install PHP 7.2 on Ubuntu 16.04"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div><p><img decoding=\"async\" class=\"alignnone size-full wp-image-27886\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/08\/How-to-Install-PHP-7.2-on-Ubuntu-16.04.jpg\" alt=\"How to Install PHP 7.2 on Ubuntu 16.04\" width=\"742\" height=\"372\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/08\/How-to-Install-PHP-7.2-on-Ubuntu-16.04.jpg 742w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/08\/How-to-Install-PHP-7.2-on-Ubuntu-16.04-150x75.jpg 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/08\/How-to-Install-PHP-7.2-on-Ubuntu-16.04-300x150.jpg 300w\" sizes=\"(max-width: 742px) 100vw, 742px\" \/><\/p>\n<p><img decoding=\"async\" class=\"alignright size-full wp-image-28515\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/08\/installing-php-7.2-on-Ubuntu-16.04.jpg\" alt=\"installing php 7.2 on Ubuntu 16.04\" width=\"200\" height=\"72\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/08\/installing-php-7.2-on-Ubuntu-16.04.jpg 200w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/08\/installing-php-7.2-on-Ubuntu-16.04-150x54.jpg 150w\" sizes=\"(max-width: 200px) 100vw, 200px\" \/>In this tutorial, we will show you how to install PHP 7.2 on Ubuntu 16.04. PHP (Hypertext Preprocessor) is an open-source server-side scripting language designed primarily for creating dynamic interactive websites. PHP is one of the most popular languages and it is freely available for redistribution and modifications. PHP can be run on almost any web server ( e.g. Nginx, Apache) and every OS platform (Linux, Mac OS, Windows). PHP 7.2 has been officially released last year and it is available for all RoseHosting clients.\u00a0The latest PHP 7.2 release has new and improved features and functions that will allow developers to write better code.<\/p>\n<p><!--more--><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69cb611dba7fd\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69cb611dba7fd\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/#Requirements\" >Requirements:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/#Step-1-Connect-to-your-server-via-SSH-and-update-your-server-OS-packages\" >Step 1: Connect to your server via SSH and update your server OS packages<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/#Step-2-Install-a-Web-Server\" >Step 2: Install a Web Server<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/#Step-3-Install-Ondrej-Surys-PPA\" >Step 3: Install\u00a0Ond\u0159ej Sur\u00fd&#8217;s PPA<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/#Step-4-Install-PHP-72\" >Step 4: Install PHP 7.2<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/#Step-5-Search-and-install-specific-PHP-72-extensions\" >Step 5: Search and install specific PHP 7.2 extensions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/#Step-7-Install-most-commonly-used-PHP-extensions\" >Step 7: Install most commonly used PHP extensions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/#Step-8-Check-the-PHP-installation\" >Step 8: Check the PHP installation<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/#Disable-PHP-70\" >Disable PHP 7.0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/#Enable-PHP-72\" >Enable PHP 7.2<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Requirements\"><\/span>Requirements:<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li>For the purposes of this tutorial, we will use an Ubuntu VPS. Our <a href=\"https:\/\/www.rosehosting.com\/ubuntu-hosting.html\">Ubuntu 16.04 VPS<\/a> already comes preinstalled with a fully working LAMP stack. However, we will still go through all the necessary steps and show you how to install and configure the LAMP stack yourself, in case you are doing this on a clean server.<\/li>\n<li>Full SSH root access or a <a href=\"https:\/\/www.rosehosting.com\/blog\/how-to-create-a-sudo-user-on-ubuntu\/\">user with sudo privileges<\/a> is also required.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Step-1-Connect-to-your-server-via-SSH-and-update-your-server-OS-packages\"><\/span>Step 1: Connect to your server via SSH and update your server OS packages<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Before we begin, let&#8217;s <a href=\"https:\/\/www.rosehosting.com\/blog\/connect-to-your-linux-vps-via-ssh\/\">connect to your VPS via SSH<\/a> as user root and update your Ubuntu OS packages to the latest available version.<\/p>\n<p>To connect to your server via SSH as user root, use the following command:<\/p>\n<pre>ssh root@IP_ADDRESS -p PORT_NUMBER<\/pre>\n<p>Replace &#8220;IP_ADDRESS&#8221; and &#8220;PORT_NUMBER&#8221; with your actual server IP address and SSH port number.<\/p>\n<p>Once logged in, make sure that your server OS packages are up-to-date by running the following commands:<\/p>\n<pre>apt-get update\r\napt-get upgrade<\/pre>\n<p>If this is your first time logging into your brand new Ubuntu VPS, you can also check our\u00a0<a href=\"https:\/\/www.rosehosting.com\/blog\/first-steps-after-getting-an-ubuntu-vps\/\" rel=\"noopener\">First Steps After Getting An Ubuntu VPS<\/a> tutorial for some additional basic initial server setup and security tips.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Step-2-Install-a-Web-Server\"><\/span>Step 2: Install a Web Server<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In this section, we will show you how to install a web server on your VPS. We can install Apache, or nginx as a web server. For the purpose of this tutorial, we will install the Apache web server. Apache is a fast and secure web server and one of the most popular and widely used web server in the world.<\/p>\n<p>To install the Apache web server, run the following command on your server:<\/p>\n<pre>apt-get install apache2<\/pre>\n<p>After the installation is complete, you should start Apache:<\/p>\n<pre>systemctl start apache2<\/pre>\n<p>Also, you can enable Apache to start automatically on server boot:<\/p>\n<pre>systemctl enable apache2<\/pre>\n<p>To check the status of the Apache web server and make sure it is up and running, you can use the following command:<\/p>\n<pre>systemctl status apache2<\/pre>\n<p>To verify that Apache is running, you can also open your web browser and enter your server IP address, (e.g. <strong>http:\/\/your_server_ip_address<\/strong>). If Apache is successfully installed, you should see the Apache default welcome page.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Step-3-Install-Ondrej-Surys-PPA\"><\/span>Step 3: Install\u00a0Ond\u0159ej Sur\u00fd&#8217;s PPA<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>PHP 7.2 can be installed using Ond\u0159ej Sur\u00fd&#8217;s PPA, so install\u00a0the software-properties-common and python-software-properties packages:<\/p>\n<pre>sudo\u00a0apt-get install software-properties-common python-software-properties<\/pre>\n<p>Then, add the ondrej PPA and update your sources:<\/p>\n<pre>sudo add-apt-repository -y ppa:ondrej\/php\r\nsudo apt-get update<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Step-4-Install-PHP-72\"><\/span>Step 4: Install PHP 7.2<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Install PHP 7.2 using the following command:<\/p>\n<pre>sudo apt-get install php7.2 php7.2-cli php7.2-common<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Step-5-Search-and-install-specific-PHP-72-extensions\"><\/span>Step 5: Search and install specific PHP 7.2 extensions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>If you want to install a specific PHP 7.2 extension, you can search if it is available using the following command:<\/p>\n<pre>sudo apt search php7.2<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Step-7-Install-most-commonly-used-PHP-extensions\"><\/span>Step 7: Install most commonly used PHP extensions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To install the most commonly used PHP extensions you can use the following command:<\/p>\n<pre>sudo apt-get install php7.2-curl php7.2-gd php7.2-json php7.2-mbstring php7.2-intl php7.2-mysql php7.2-xml php7.2-zip<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Step-8-Check-the-PHP-installation\"><\/span>Step 8: Check the PHP installation<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Use the following command to check the PHP version installed on your server:<\/p>\n<pre>php -v<\/pre>\n<p>You should receive the following output:<\/p>\n<pre>PHP 7.2.9-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Aug 19 2018 07:16:12) ( NTS )\r\nCopyright (c) 1997-2018 The PHP Group\r\nZend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies\r\n    with Zend OPcache v7.2.9-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies<\/pre>\n<p>Now, PHP 7.2 has been installed on your Ubuntu server, and if we want to change the default PHP version to PHP 7.2 that is used by the web server, we need to disable the old PHP 7.0 version and enable the newly installed one.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Disable-PHP-70\"><\/span>Disable PHP 7.0<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre>a2dismod php7.0<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Enable-PHP-72\"><\/span>Enable PHP 7.2<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre>a2enmod php7.2<\/pre>\n<p>Restart the Apache web server for the changes to take effect:<\/p>\n<pre>systemctl restart apache2<\/pre>\n<p>To test your installation and check that Apache, PHP and PHP extensions are working properly, create a new php info file:<\/p>\n<pre>vi \/var\/www\/html\/phpinfo.php<\/pre>\n<p>Add the following content to it:<\/p>\n<pre>&lt;?php phpinfo(); ?&gt;<\/pre>\n<p>Open the \u2018phpinfo.php\u2019 file using a web browser:<\/p>\n<pre>http:\/\/&lt;ip-address&gt;\/phpinfo.php or http:\/\/&lt;your-domain.com&gt;\/phpinfo.php<\/pre>\n<p>and view the current information about PHP on your server.<br \/>\n<img decoding=\"async\" class=\"alignnone wp-image-34455 size-full\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/08\/install-php-7.2.png\" alt=\"install php 7.2\" width=\"742\" height=\"59\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/08\/install-php-7.2.png 742w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/08\/install-php-7.2-300x24.png 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/08\/install-php-7.2-150x12.png 150w\" sizes=\"(max-width: 742px) 100vw, 742px\" \/>That\u2019s it. You have successfully installed PHP 7.2 on an Ubuntu 16.04 server. For more information about PHP 7, please refer to the official <a href=\"http:\/\/php.net\/docs.php\">PHP\u00a0documentation<\/a>.<\/p>\n<hr \/>\n<p><img decoding=\"async\" class=\"alignleft size-full wp-image-27887\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/08\/Install-PHP-7.2-on-Ubuntu-16.04.jpg\" alt=\"Install PHP 7.2 on Ubuntu 16.04\" width=\"200\" height=\"102\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/08\/Install-PHP-7.2-on-Ubuntu-16.04.jpg 200w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/08\/Install-PHP-7.2-on-Ubuntu-16.04-150x77.jpg 150w\" sizes=\"(max-width: 200px) 100vw, 200px\" \/> Of course, you don\u2019t have to <strong>install PHP 7.2 on Ubuntu 16.04<\/strong>, if you use one of our\u00a0<a href=\"https:\/\/www.rosehosting.com\/php-hosting.html\">Managed PHP 7.2 Hosting<\/a> services, in which case you can simply ask our expert system administrators to install PHP 7.2 on Ubuntu 16.04 for you, using the LAMP or LEMP stack or any other web hosting stack of your choice. They are available 24\u00d77 and will take care of your request immediately. For more updates, you can also consider reading our guide on <a href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-8-on-ubuntu-20-04\/\">How to Install PHP 8 on Ubuntu 20.04<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we will show you how to install PHP 7.2 on Ubuntu 16.04. PHP (Hypertext Preprocessor) is an &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to Install PHP 7.2 on Ubuntu 16.04\" class=\"read-more button\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/#more-27881\" aria-label=\"Read more about How to Install PHP 7.2 on Ubuntu 16.04\">Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":27886,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,1698,1712],"tags":[1742,1625,59],"class_list":["post-27881","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","category-ubuntu","category-web-frameworks","tag-install-php","tag-php-7-2","tag-ubuntu","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How To Install PHP 7.2 On Ubuntu 16.04 | RoseHosting<\/title>\n<meta name=\"description\" content=\"Learn how to install PHP 7.2 on ubuntu 16.04. Installing PHP on Ubuntu 16.04 with this tutorial is incredibly easy.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install PHP 7.2 on Ubuntu 16.04\" \/>\n<meta property=\"og:description\" content=\"How to Install PHP 7.2 on Ubuntu 16.04 | RoseHosting\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/\" \/>\n<meta property=\"og:site_name\" content=\"RoseHosting\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/RoseHosting\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/rosehosting.helpdesk\" \/>\n<meta property=\"article:published_time\" content=\"2018-08-21T09:01:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-12-12T13:23:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/08\/How-to-Install-PHP-7.2-on-Ubuntu-16.04.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"742\" \/>\n\t<meta property=\"og:image:height\" content=\"372\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jeff Wilson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:site\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeff Wilson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/\"},\"author\":{\"name\":\"Jeff Wilson\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713\"},\"headline\":\"How to Install PHP 7.2 on Ubuntu 16.04\",\"datePublished\":\"2018-08-21T09:01:39+00:00\",\"dateModified\":\"2022-12-12T13:23:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/\"},\"wordCount\":782,\"commentCount\":6,\"publisher\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/08\/How-to-Install-PHP-7.2-on-Ubuntu-16.04.jpg\",\"keywords\":[\"install PHP\",\"PHP 7.2\",\"ubuntu\"],\"articleSection\":[\"Tutorials\",\"Ubuntu\",\"Web Frameworks\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/\",\"url\":\"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/\",\"name\":\"How To Install PHP 7.2 On Ubuntu 16.04 | RoseHosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/08\/How-to-Install-PHP-7.2-on-Ubuntu-16.04.jpg\",\"datePublished\":\"2018-08-21T09:01:39+00:00\",\"dateModified\":\"2022-12-12T13:23:27+00:00\",\"description\":\"Learn how to install PHP 7.2 on ubuntu 16.04. Installing PHP on Ubuntu 16.04 with this tutorial is incredibly easy.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/#primaryimage\",\"url\":\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/08\/How-to-Install-PHP-7.2-on-Ubuntu-16.04.jpg\",\"contentUrl\":\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/08\/How-to-Install-PHP-7.2-on-Ubuntu-16.04.jpg\",\"width\":742,\"height\":372,\"caption\":\"How to Install PHP 7.2 on Ubuntu 16.04\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.rosehosting.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install PHP 7.2 on Ubuntu 16.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#website\",\"url\":\"https:\/\/www.rosehosting.com\/blog\/\",\"name\":\"RoseHosting.com\",\"description\":\"Premium Linux Tutorials Since 2001\",\"publisher\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.rosehosting.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#organization\",\"name\":\"RoseHosting\",\"url\":\"https:\/\/www.rosehosting.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png\",\"contentUrl\":\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png\",\"width\":192,\"height\":192,\"caption\":\"RoseHosting\"},\"image\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/RoseHosting\",\"https:\/\/x.com\/rosehosting\",\"https:\/\/www.linkedin.com\/in\/rosehosting\/\"],\"description\":\"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.\",\"email\":\"info@rosehosting.com\",\"telephone\":\"(314) 275-0414\",\"legalName\":\"Rose Web Services LLC\",\"foundingDate\":\"2001-04-02\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"11\",\"maxValue\":\"50\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713\",\"name\":\"Jeff Wilson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"caption\":\"Jeff Wilson\"},\"description\":\"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.\",\"sameAs\":[\"https:\/\/www.rosehosting.com\",\"https:\/\/www.facebook.com\/rosehosting.helpdesk\"],\"url\":\"https:\/\/www.rosehosting.com\/blog\/author\/jwilson\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How To Install PHP 7.2 On Ubuntu 16.04 | RoseHosting","description":"Learn how to install PHP 7.2 on ubuntu 16.04. Installing PHP on Ubuntu 16.04 with this tutorial is incredibly easy.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/","og_locale":"en_US","og_type":"article","og_title":"How to Install PHP 7.2 on Ubuntu 16.04","og_description":"How to Install PHP 7.2 on Ubuntu 16.04 | RoseHosting","og_url":"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/","og_site_name":"RoseHosting","article_publisher":"https:\/\/www.facebook.com\/RoseHosting","article_author":"https:\/\/www.facebook.com\/rosehosting.helpdesk","article_published_time":"2018-08-21T09:01:39+00:00","article_modified_time":"2022-12-12T13:23:27+00:00","og_image":[{"width":742,"height":372,"url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/08\/How-to-Install-PHP-7.2-on-Ubuntu-16.04.jpg","type":"image\/jpeg"}],"author":"Jeff Wilson","twitter_card":"summary_large_image","twitter_creator":"@rosehosting","twitter_site":"@rosehosting","twitter_misc":{"Written by":"Jeff Wilson","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/#article","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/"},"author":{"name":"Jeff Wilson","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713"},"headline":"How to Install PHP 7.2 on Ubuntu 16.04","datePublished":"2018-08-21T09:01:39+00:00","dateModified":"2022-12-12T13:23:27+00:00","mainEntityOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/"},"wordCount":782,"commentCount":6,"publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/08\/How-to-Install-PHP-7.2-on-Ubuntu-16.04.jpg","keywords":["install PHP","PHP 7.2","ubuntu"],"articleSection":["Tutorials","Ubuntu","Web Frameworks"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/","url":"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/","name":"How To Install PHP 7.2 On Ubuntu 16.04 | RoseHosting","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/#primaryimage"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/08\/How-to-Install-PHP-7.2-on-Ubuntu-16.04.jpg","datePublished":"2018-08-21T09:01:39+00:00","dateModified":"2022-12-12T13:23:27+00:00","description":"Learn how to install PHP 7.2 on ubuntu 16.04. Installing PHP on Ubuntu 16.04 with this tutorial is incredibly easy.","breadcrumb":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/#primaryimage","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/08\/How-to-Install-PHP-7.2-on-Ubuntu-16.04.jpg","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/08\/How-to-Install-PHP-7.2-on-Ubuntu-16.04.jpg","width":742,"height":372,"caption":"How to Install PHP 7.2 on Ubuntu 16.04"},{"@type":"BreadcrumbList","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-php-7-2-on-ubuntu-16-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.rosehosting.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Install PHP 7.2 on Ubuntu 16.04"}]},{"@type":"WebSite","@id":"https:\/\/www.rosehosting.com\/blog\/#website","url":"https:\/\/www.rosehosting.com\/blog\/","name":"RoseHosting.com","description":"Premium Linux Tutorials Since 2001","publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rosehosting.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.rosehosting.com\/blog\/#organization","name":"RoseHosting","url":"https:\/\/www.rosehosting.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","width":192,"height":192,"caption":"RoseHosting"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/RoseHosting","https:\/\/x.com\/rosehosting","https:\/\/www.linkedin.com\/in\/rosehosting\/"],"description":"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.","email":"info@rosehosting.com","telephone":"(314) 275-0414","legalName":"Rose Web Services LLC","foundingDate":"2001-04-02","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"11","maxValue":"50"}},{"@type":"Person","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713","name":"Jeff Wilson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","caption":"Jeff Wilson"},"description":"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.","sameAs":["https:\/\/www.rosehosting.com","https:\/\/www.facebook.com\/rosehosting.helpdesk"],"url":"https:\/\/www.rosehosting.com\/blog\/author\/jwilson\/"}]}},"_links":{"self":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/27881","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/comments?post=27881"}],"version-history":[{"count":10,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/27881\/revisions"}],"predecessor-version":[{"id":44148,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/27881\/revisions\/44148"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media\/27886"}],"wp:attachment":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media?parent=27881"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/categories?post=27881"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/tags?post=27881"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}