# Debian

> Section in “Introduction › Getting PHP 7” of the book [PHP 7 Explained](https://php7explained.com/) by Sebastian Bergmann and Stefan Priebsch, published by thePHP.cc. The book covers PHP 7.0 to 7.4 and was last updated in November 2020. HTML version: <https://php7explained.com/introduction/getting-php-7/debian/>

At the time of writing, Debian 10.3 was the current version of this DEB-based Linux distribution. It ships with PHP 7.3 by default.

The [package repository](https://deb.sury.org/) maintained by Ondřej Surý is commonly used for installing newer PHP versions on Debian. Here is how you can add this repository to your package manager configuration and upgrade to PHP 7.4:

    $ sudo apt-get install apt-transport-https \
                           lsb-release \
                           ca-certificates \
                           wget

    $ wget -O \
           /etc/apt/trusted.gpg.d/php.gpg \
           https://packages.sury.org/php/apt.gpg

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

    $ sudo apt-get update

    $ sudo apt-get upgrade

---

Previous: [Fedora](https://php7explained.com/introduction/getting-php-7/fedora/index.html.md) | Next: [Ubuntu](https://php7explained.com/introduction/getting-php-7/ubuntu/index.html.md)
