I am looking to install at least PHP 7.0 on Debian 8.7 but from searching around I am finding it hard to find a reliable source that shows me how to do it. It seems so difficult, I have come across DotDeb but I read bad things about using it and I am not sure what the best way to install PHP 7.0 on Debian is?

  • What bad things did you read? And why does that scare you off DotDeb but not off Debian itself? Feb 26, 2017 at 22:46

1 Answer 1


You can install it by adding the repository and using the normal apt package management functions.

sudo apt update
sudo apt install apt-transport-https lsb-release ca-certificates -y

sudo wget -O /etc/apt/trusted.gpg.d/php.gpg \

echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" |
sudo tee /etc/apt/sources.list.d/php.list

sudo apt update
# 7.1 is out so select your number accordingly
sudo apt install php7.X -y 


  • 3
    You also need to state where these packages come from and why you are recommending them. Feb 26, 2017 at 22:56
  • 1
    The repository is maintained by the the maintainer of PHP in Debian proper: qa.debian.org/developer.php?login=ondrej%40debian.org
    – jordanm
    Feb 27, 2017 at 0:05
  • In my case $(lsb_release -sc) causes problems. Had to replace with explicit version name i.e. deb https://packages.sury.org/php/ jessie main
    – Czar
    May 22, 2017 at 1:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.