How to install PHP 7 in Debian 8

Share this post to your friends !
  • 1

SystemMen - How to install PHP 7 in Debian 8? By default, if you install the PHP package in Debian 8, it will install version 5.x. This article, I will guide you to install PHP 7 in Debian 8 using the dotdeb repository.

Add repository PHP 7 dotdeb

Important note: This repository is provided by This is not an official repository, you may consider using it. All depends on you, I can not guarantee anything with this repository.

First, you need to add the dotdeb repository address in the source list configuration file of Debian. Type the command below. All the commands below need user root to execute. Otherwise you must type sudo before each command.

how-to-install-php-7-in-debian-8-01 How to install PHP 7 in Debian 8
Install PHP 7 in Debian 8 using the dotdeb repository.
echo "deb jessie all" >> /etc/apt/sources.list
echo "deb-src jessie all" >> /etc/apt/sources.list

Next, you need to download the gpg key of the new repository. You type the following commands in turn.

cd /tmp
apt-key add dotdeb.gpg
rm -f /tmp/dotdeb.gpg

Then, you type update command to update new packages for PHP.

apt-get update

Install PHP 7 in Debian 8

Now, you can install PHP 7 using the command below.

apt-get install php7.0 php7.0-fpm php7.0-gd php7.0-mysql -y

The above command will install almost all the necessary php packages. The PHP version is 7.0.28-1~dotdeb+8.1.

how-to-install-php-7-in-debian-8-02 How to install PHP 7 in Debian 8
Display php version after installation finished.

Once the installation is complete, you can type the following command to see the correct version.

php -v
If you liked this article, then please subscribe to our YouTube Channel for more video tutorials. You can also find us on Twitter and Facebook.

Share this post to your friends !
  • 1
If you appreciate what we share in this blog, you can support us by:
  1. Stay connected to: Facebook | Twitter | Google Plus | YouTube
  2. Subscribe email to recieve new posts from us: Sign up now.
  3. Start your own blog with SSD VPS - Free Let's Encrypt SSL ($2.5/month).
  4. Become a Supporter - Make a contribution via PayPal.
  5. Support us by purchasing Ribbon Lite Child theme being using on this website.

We are thankful for your support.

«« »»

Got something to say? Join the discussion

Please keep in mind that all comments are subject to our Comment Policy. Your email address will not be published.
This site uses Akismet to reduce spam. Learn how your comment data is processed.