admin/ July 9, 2016/ Linux/ 0 comments

Install Php5.5, Php5.6 and Php7.0 on Ubuntu Server

To install Php, Add repository in to your sourceslist. This repository can be used for any of them PHP version to be install on Ubuntu Server.

Step 1-:  Add repository into sourceslist

Open sources.list file using below command.

$ sudo nano /etc/apt/sources.list

Add the below line into to the bottom of sources.list .

deb http://ppa.launchpad.net/ondrej/php/ubuntu wily main
deb-src http://ppa.launchpad.net/ondrej/php/ubuntu wily main

save the file.

Step 2-: Update the apt repository.

$ sudo apt-get update

Step 3-:  Install PHP version you required.

To install Php-5.5

$ sudo apt-get install php5.5

To install Php-5.6

$ sudo apt-get install php5.6

To install Php-7.0

$ sudo apt-get install php7.0

or

$ sudo apt-get install php

By default it will install Php7.0.

Leave a Reply