How to Install PHP 7.0 & 5.6 on Debian 8/7 using PPA

Firstly say thanks to dotdeb.org for maintaining the packages of PHP from many years. This article will help you to install PHP 7.0 & PHP 5.6 on Debian 8 (Jessie) and Debian 7 (Wheezy) systems using PPA.

Add PPA in System

Firstly you need to add Dotdeb PPA on your system. Before adding PPA first import the GPG key of Dotdeb repository.
$ sudo apt-get install curl $ curl https://www.dotdeb.org/dotdeb.gpg | sudo apt-key add - 
Now use the following commands to add PPA in your system.

Debian 8 Jessie

$ echo 'deb http://packages.dotdeb.org jessie all' >> /etc/apt/sources.list $ echo 'deb-src http://packages.dotdeb.org jessie all' >> /etc/apt/sources.list 

Debian 7 Wheezy

$ echo 'deb http://packages.dotdeb.org wheezy all' >> /etc/apt/sources.list $ echo 'deb-src http://packages.dotdeb.org wheezy all' >> /etc/apt/sources.list 

Install PHP 7.0

Use the following set of commands to add PPA for PHP 7 in your Ubuntu system and install it.
$ sudo apt-get update $ sudo apt-get install php7.0 
Now use the following command to check installed php version on your system.
$ php -v   PHP 7.0.15-1~dotdeb+8.1 (cli) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies     with Zend OPcache v7.0.15-1~dotdeb+8.1, Copyright (c) 1999-2017, by Zend Technologies 

Install PHP 5.6

Use the following set of commands to add PPA for PHP 5.6 in your Debian system and install it.
$ sudo apt-get update $ sudo apt-get install php5 
Now use the following command to check installed php version on your system.
$ php -v   PHP 5.6.29-0+deb8u1 (cli) (built: Dec 13 2016 16:02:08) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies     with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies 
Congratulation! Enjoy the development with PHP 7.0 or PHP 5.6 on Debian system.

Thanks for Visit Here

Comments