{"id":969,"date":"2017-01-04T12:25:58","date_gmt":"2017-01-04T06:55:58","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=969"},"modified":"2017-01-04T12:25:58","modified_gmt":"2017-01-04T06:55:58","slug":"install-apache-2-4-php5-6-ubuntu-16-04","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/install-apache-2-4-php5-6-ubuntu-16-04\/","title":{"rendered":"Install apache 2.4, php5.6 on Ubuntu 16.04"},"content":{"rendered":"<p><strong>Date Posted on:04-01-2017<\/strong><\/p>\n<p>Ubuntu 16.04 doesn&#8217;t have php 5.6 by default. Normally, if we install php on ubuntu 16.04, it will install php 7. Many application (at the time of this post 04-01-2017) runs only with php 5.6 and may face issue with Php7. In this post, we are gonna explain on how to install php 5.6.<\/p>\n<h5><strong>Assumption:<\/strong><\/h5>\n<ol>\n<li>Ubuntu 16.04<\/li>\n<li>Server Root access<\/li>\n<\/ol>\n<h5><strong>Installation:<\/strong><\/h5>\n<p>Add a PPA repo(Personal Package Archive) to the server.<\/p>\n<p><code>add-apt-repository ppa:ondrej\/php<\/code><\/p>\n<p>Since this post deals with php 5.6, we haven&#8217;t included any steps to install previous version of php such as php 5.5 or php 5.4. Moreover, php 5.5 and php 5.4 are no longer supported with security updates.<\/p>\n<p>Now, Install php 5.6 application using apt-get.<\/p>\n<p><code>apt-get install php5.6 php5.6-dev php5.6-curl php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml php5.6-zip<\/code><\/p>\n<p>You will prompted to\u00a0<strong>Press Enter\u00a0<\/strong>to continue. To continue, press\u00a0<strong><em>Enter\u00a0<\/em><\/strong>continue<\/p>\n<p>The above command will \u00a0most of the dependencies including\u00a0<em>apache2\u00a0<\/em>and all other dependency packages.<\/p>\n<p>Start apache2 service and enable the service on systemctl.<\/p>\n<p><code>systemctl start apache2<\/code><\/p>\n<p><code>systemctl enable apache2<\/code><\/p>\n<p>Let&#8217;s check the php version.<\/p>\n<p><code>php -v<br \/>\nPHP 5.6.29-1+deb.sury.org~xenial+1 (cli)<br \/>\nCopyright (c) 1997-2016 The PHP Group<br \/>\nZend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies<\/code><\/p>\n<p>&nbsp;<\/p>\n<p>Create a phpinfo page on the domain documentroot or server documentroot. By default, the location will be\u00a0<span style=\"text-decoration: underline;\">\/var\/www\/html<\/span><\/p>\n<p><code>vi \/var\/www\/html\/info.php<\/code><\/p>\n<blockquote><p>&lt;?php<\/p>\n<p>phpinfo();<\/p>\n<p>?&gt;<\/p><\/blockquote>\n<p>Access the page on the browser <em>http:\/\/IPADDRESS\/info.php<\/em>. You will see php info page with php 5.6 version.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Date Posted on:04-01-2017 Ubuntu 16.04 doesn&#8217;t have php 5.6 by default. Normally, if we install php on ubuntu 16.04, it [&hellip;]<\/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-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":"","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-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":"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":""},"mobile":{"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":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1022],"tags":[278,261,279,274],"class_list":["post-969","post","type-post","status-publish","format-standard","hentry","category-web-architecture","tag-apache","tag-linux","tag-php5-6","tag-ubuntu","psol-cat-web-architecture"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-fD","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/969","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=969"}],"version-history":[{"count":0,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/969\/revisions"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=969"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=969"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=969"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}