Tuesday, May 1, 2018

How to Install PHP 5.6 on Ubuntu 16.04

How to Install PHP 5.6 on Ubuntu 16.04

How to Install PHP 5.6 on Ubuntu 16.04

This time we will discuss about how to install php 5.6 in ubuntu 16.04. Currently ubuntu 16.04 defaults if we install php that we can is php 7, but sometimes the application that we created only running in php 5.6. here we will discuss how to overcome this is install php 5.6 in ubuntu 16.04.

Add Repository

Before starting the ubuntu installation, we need to add php 5.6 repository so we can install php 5.6 in ubuntu 16.04. The repository we use is from Ondej repository. follow the command below to install the repository.

sudo apt-get update
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ondrej/php

Install PHP 5.6

After finished adding repository in ubuntu 16.04 we are ready for php 5.6 installation in ubuntu 16.04.

Update your repository

sudo apt update
Install PHP 5.6

sudo apt-get install -y php5.6
To check your php version follow this command

php -v
How to Install PHP 5.6 on Ubuntu 16.04


If we have previously installed php 7, we do not have to delete php 7 us. We can move functional to php 5.6, follow the command below to move functional to php 5.6.


sudo update-alternatives --config php
How to Install PHP 5.6 on Ubuntu 16.04

Now we move functional from php 7 to php 5.6.
NEXT ARTICLE Next Post
PREVIOUS ARTICLE Previous Post
NEXT ARTICLE Next Post
PREVIOUS ARTICLE Previous Post