{"id":1781,"date":"2016-04-19T14:24:58","date_gmt":"2016-04-19T18:24:58","guid":{"rendered":"https:\/\/www.globo.tech\/learning-center\/?p=1781"},"modified":"2017-04-19T15:58:28","modified_gmt":"2017-04-19T19:58:28","slug":"how-to-upgrade-to-php-7-on-ubuntu-14-04","status":"publish","type":"post","link":"https:\/\/www.globo.tech\/learning-center\/how-to-upgrade-to-php-7-on-ubuntu-14-04\/","title":{"rendered":"How to Upgrade to PHP 7 on Ubuntu 14.04"},"content":{"rendered":"<h2>PHP 7<\/h2>\n<p>PHP skip a version in its release and went directly from 5 to 7 but what a difference it makes in term of performances. PHP7 performances gain has been very impressive and it has been design to be retro compatible with code developed on PHP5. Here are the steps to do the upgrade on Ubuntu 14.04 LTS with a standard LAMP installation.<\/p>\n<div class=\"alert alert-danger\"><span style=\"text-decoration: underline;\"><strong>Warning!<\/strong><\/span> We recommend that you first test you website on PHP7 in a sandbox and that you have a full backup of your data before making any changes in production.<\/div>\n<h2>GETTING STARTED<\/h2>\n<p>To complete this guide, you will need the following:<br \/>\n\u2022 1 Node (<a href=\"https:\/\/www.globo.tech\/cloud-server-pricing\" target=\"_blank\">Cloud Server<\/a> or <a href=\"http:\/\/www.globo.tech\/dedicated-server-hosting\" target=\"_blank\">Dedicated Servers<\/a>) with Ubuntu 14.04 LTS running a LAMP installation<\/p>\n<h2>Upgrade to PHP7<\/h2>\n<p>First, update the apt sources.<\/p>\n<p><code>apt-get update<\/code><\/p>\n<p>Then, we install the python-software-properties package to manage additional repositories properly.<\/p>\n<p><code>apt-get install python-software-properties<\/code><\/p>\n<p>As PHP 7 is not yet available in the default repositories, we need to get it from a custom one. Use the following command:<\/p>\n<p><code>add-apt-repository ppa:ondrej\/php<\/code><\/p>\n<p>Once the repository is added, apt needs to update again to add the new packages to its list.<\/p>\n<p><code>apt-get update<\/code><\/p>\n<p>Finally, we can proceed with the installation of php7 packages and lamp modules<\/p>\n<p><code>apt-get install -y php7.0<br \/>\napt-get install libapache2-mod-php7.0 php7.0-mysql php7.0-curl php7.0-json<\/code><\/p>\n<p>To ensure proper connection to MySQL, we then enable the mysqli module in the new PHP and restart.<\/p>\n<p><code>phpenmod mysqli<br \/>\nservice apache2 restart<\/code><\/p>\n<h2>Conclusion<\/h2>\n<p>Your server is now running PHP7. Give us your feedback on how PHP7 improved your website performances and don&#8217;t forget to share this article with your friends. <\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>PHP7 performances gain has been very impressive and it has been design to be retro compatible with code developed on PHP5. Here are the steps to do the upgrade on Ubuntu 14.04 LTS with a standard LAMP installation.<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":3,"featured_media":1701,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[71,50],"tags":[],"class_list":["post-1781","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-applications","category-tutorials","operating_system-ubuntu-14-04"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Upgrade to PHP 7 on Ubuntu 14.04 - Globo.Tech<\/title>\n<meta name=\"description\" content=\"This tutorial will show you how to upgrade to PHP 7 on your Ubuntu 14.04 server. Read now &amp; Experience performance gain from PHP 7 !\" \/>\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.globo.tech\/learning-center\/how-to-upgrade-to-php-7-on-ubuntu-14-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Upgrade to PHP 7 on Ubuntu 14.04 - Globo.Tech\" \/>\n<meta property=\"og:description\" content=\"This tutorial will show you how to upgrade to PHP 7 on your Ubuntu 14.04 server. Read now &amp; Experience performance gain from PHP 7 !\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.globo.tech\/learning-center\/how-to-upgrade-to-php-7-on-ubuntu-14-04\/\" \/>\n<meta property=\"og:site_name\" content=\"Globo.Tech\" \/>\n<meta property=\"article:published_time\" content=\"2016-04-19T18:24:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-04-19T19:58:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/03\/globotech_php7_banner_rev.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"360\" \/>\n\t<meta property=\"og:image:height\" content=\"245\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"GloboTech Communications\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"GloboTech Communications\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/how-to-upgrade-to-php-7-on-ubuntu-14-04\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/how-to-upgrade-to-php-7-on-ubuntu-14-04\\\/\"},\"author\":{\"name\":\"GloboTech Communications\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#\\\/schema\\\/person\\\/e17784b37f4a4f49b7bc611847912e87\"},\"headline\":\"How to Upgrade to PHP 7 on Ubuntu 14.04\",\"datePublished\":\"2016-04-19T18:24:58+00:00\",\"dateModified\":\"2017-04-19T19:58:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/how-to-upgrade-to-php-7-on-ubuntu-14-04\\\/\"},\"wordCount\":241,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/how-to-upgrade-to-php-7-on-ubuntu-14-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/wp-content\\\/uploads\\\/2016\\\/03\\\/globotech_php7_banner_rev.jpg\",\"articleSection\":[\"Applications\",\"Tutorials\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/how-to-upgrade-to-php-7-on-ubuntu-14-04\\\/\",\"url\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/how-to-upgrade-to-php-7-on-ubuntu-14-04\\\/\",\"name\":\"How to Upgrade to PHP 7 on Ubuntu 14.04 - Globo.Tech\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/how-to-upgrade-to-php-7-on-ubuntu-14-04\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/how-to-upgrade-to-php-7-on-ubuntu-14-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/wp-content\\\/uploads\\\/2016\\\/03\\\/globotech_php7_banner_rev.jpg\",\"datePublished\":\"2016-04-19T18:24:58+00:00\",\"dateModified\":\"2017-04-19T19:58:28+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#\\\/schema\\\/person\\\/e17784b37f4a4f49b7bc611847912e87\"},\"description\":\"This tutorial will show you how to upgrade to PHP 7 on your Ubuntu 14.04 server. Read now & Experience performance gain from PHP 7 !\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/how-to-upgrade-to-php-7-on-ubuntu-14-04\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/how-to-upgrade-to-php-7-on-ubuntu-14-04\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/how-to-upgrade-to-php-7-on-ubuntu-14-04\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/wp-content\\\/uploads\\\/2016\\\/03\\\/globotech_php7_banner_rev.jpg\",\"contentUrl\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/wp-content\\\/uploads\\\/2016\\\/03\\\/globotech_php7_banner_rev.jpg\",\"width\":360,\"height\":245,\"caption\":\"upgrade php 7\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/how-to-upgrade-to-php-7-on-ubuntu-14-04\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Upgrade to PHP 7 on Ubuntu 14.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#website\",\"url\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/\",\"name\":\"Globo.Tech\",\"description\":\"Welcome to the Official Globo.Tech Learning Center\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#\\\/schema\\\/person\\\/e17784b37f4a4f49b7bc611847912e87\",\"name\":\"GloboTech Communications\",\"sameAs\":[\"http:\\\/\\\/www.gtcomm.net\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Upgrade to PHP 7 on Ubuntu 14.04 - Globo.Tech","description":"This tutorial will show you how to upgrade to PHP 7 on your Ubuntu 14.04 server. Read now & Experience performance gain from PHP 7 !","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.globo.tech\/learning-center\/how-to-upgrade-to-php-7-on-ubuntu-14-04\/","og_locale":"en_US","og_type":"article","og_title":"How to Upgrade to PHP 7 on Ubuntu 14.04 - Globo.Tech","og_description":"This tutorial will show you how to upgrade to PHP 7 on your Ubuntu 14.04 server. Read now & Experience performance gain from PHP 7 !","og_url":"https:\/\/www.globo.tech\/learning-center\/how-to-upgrade-to-php-7-on-ubuntu-14-04\/","og_site_name":"Globo.Tech","article_published_time":"2016-04-19T18:24:58+00:00","article_modified_time":"2017-04-19T19:58:28+00:00","og_image":[{"width":360,"height":245,"url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/03\/globotech_php7_banner_rev.jpg","type":"image\/jpeg"}],"author":"GloboTech Communications","twitter_misc":{"Written by":"GloboTech Communications","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.globo.tech\/learning-center\/how-to-upgrade-to-php-7-on-ubuntu-14-04\/#article","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/how-to-upgrade-to-php-7-on-ubuntu-14-04\/"},"author":{"name":"GloboTech Communications","@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87"},"headline":"How to Upgrade to PHP 7 on Ubuntu 14.04","datePublished":"2016-04-19T18:24:58+00:00","dateModified":"2017-04-19T19:58:28+00:00","mainEntityOfPage":{"@id":"https:\/\/www.globo.tech\/learning-center\/how-to-upgrade-to-php-7-on-ubuntu-14-04\/"},"wordCount":241,"commentCount":0,"image":{"@id":"https:\/\/www.globo.tech\/learning-center\/how-to-upgrade-to-php-7-on-ubuntu-14-04\/#primaryimage"},"thumbnailUrl":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/03\/globotech_php7_banner_rev.jpg","articleSection":["Applications","Tutorials"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.globo.tech\/learning-center\/how-to-upgrade-to-php-7-on-ubuntu-14-04\/","url":"https:\/\/www.globo.tech\/learning-center\/how-to-upgrade-to-php-7-on-ubuntu-14-04\/","name":"How to Upgrade to PHP 7 on Ubuntu 14.04 - Globo.Tech","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.globo.tech\/learning-center\/how-to-upgrade-to-php-7-on-ubuntu-14-04\/#primaryimage"},"image":{"@id":"https:\/\/www.globo.tech\/learning-center\/how-to-upgrade-to-php-7-on-ubuntu-14-04\/#primaryimage"},"thumbnailUrl":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/03\/globotech_php7_banner_rev.jpg","datePublished":"2016-04-19T18:24:58+00:00","dateModified":"2017-04-19T19:58:28+00:00","author":{"@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87"},"description":"This tutorial will show you how to upgrade to PHP 7 on your Ubuntu 14.04 server. Read now & Experience performance gain from PHP 7 !","breadcrumb":{"@id":"https:\/\/www.globo.tech\/learning-center\/how-to-upgrade-to-php-7-on-ubuntu-14-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.globo.tech\/learning-center\/how-to-upgrade-to-php-7-on-ubuntu-14-04\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.globo.tech\/learning-center\/how-to-upgrade-to-php-7-on-ubuntu-14-04\/#primaryimage","url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/03\/globotech_php7_banner_rev.jpg","contentUrl":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/03\/globotech_php7_banner_rev.jpg","width":360,"height":245,"caption":"upgrade php 7"},{"@type":"BreadcrumbList","@id":"https:\/\/www.globo.tech\/learning-center\/how-to-upgrade-to-php-7-on-ubuntu-14-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.globo.tech\/learning-center\/"},{"@type":"ListItem","position":2,"name":"How to Upgrade to PHP 7 on Ubuntu 14.04"}]},{"@type":"WebSite","@id":"https:\/\/www.globo.tech\/learning-center\/#website","url":"https:\/\/www.globo.tech\/learning-center\/","name":"Globo.Tech","description":"Welcome to the Official Globo.Tech Learning Center","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87","name":"GloboTech Communications","sameAs":["http:\/\/www.gtcomm.net"]}]}},"_links":{"self":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/1781","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/comments?post=1781"}],"version-history":[{"count":35,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/1781\/revisions"}],"predecessor-version":[{"id":2804,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/1781\/revisions\/2804"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media\/1701"}],"wp:attachment":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media?parent=1781"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/categories?post=1781"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/tags?post=1781"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}