Install PHP 7.x on Debian 9, Debian 10 with Sury Package

Install Required Libraries

apt-get install gnupg2

This for adding pgp of sury packages repository, then add packages to /etc/apt/sources.list.d/

wget -qO – https://packages.sury.org/php/apt.gpg | sudo apt-key add –

Install https transport to enable apt with https method

apt-get install apt-transport-https

if not install this, you will get error message: “E: The method driver /usr/lib/apt/methods/https could not be found.”
then update your aptitude repository

apt-get update

${SUDO} apt-get -y install apt-transport-https lsb-release ca-certificates curl
${SUDO} wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
${SUDO} sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
${SUDO} apt-get update

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.