To install PHP 7 on a Debian 8 (jessie) or Debian 7 (wheezy) system, you can use the following steps:
apt.dotdeb.org
repository:sudo echo "deb http://apt.dotdeb.org jessie all" >> /etc/apt/sources.list sudo echo "deb-src http://apt.dotdeb.org jessie all" >> /etc/apt/sources.list
This repository contains the latest versions of PHP for Debian 8 and 7.
wget https://www.dotdeb.org/dotdeb.gpg sudo apt-key add dotdeb.gpg
This will add the repository signing key, which is used to verify the authenticity of the packages from the apt.dotdeb.org
repository.
sudo apt-get update
This will update the package index to include the packages from the apt.dotdeb.org
repository.
sudo apt-get install php7.0
This will install PHP 7 and its dependencies.
php -v
This will print the version of PHP that is installed on your system.