• Home
  • Ubuntu 20.04
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 20.04
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

How To Install PHP on Debian 10 (Buster)

Written by Rahul, Updated on August 22, 2019

PHP 7.3 is the latest stable release available for the installation. This tutorial will help you with the installation of PHP latest version on your Debian system. Now follow this tutorial to Install PHP on Debian 10, Buster.

Debian 10 is still under development. So this tutorial is tested with Debian 10 daily build version.

Prerequisites

Login to your Debian 10 system using shell access. For remote systems connect with SSH. Windows users can use Putty or other alternatives applications for SSH connection.

Run below commands to upgrade the current packages to the latest version.

sudo apt update 
sudo apt upgrade

Setup PPA on Debian 10

Let’s execute the following commands to install the required packages first on your system. Then import packages signing key. After that configure PPA for the PHP packages on your system.

sudo apt install ca-certificates apt-transport-https 
wget -q https://packages.sury.org/php/apt.gpg -O- | sudo apt-key add -
echo "deb https://packages.sury.org/php/ buster main" | sudo tee /etc/apt/sources.list.d/php.list

You Debian 10 system is ready for the PHP installation.

Install PHP on Debian 10

You can also install the latest PHP version on your system. Run the following commands to install PHP 7.3 on Debian 10. To install other PHP version change php7.3 with your versions like “php7.2”, “php7.1” or “php5.6” etc.

sudo apt update
sudo apt install php7.3

Also, install the required PHP modules.

sudo apt install php7.3-cli php7.3-common php7.3-curl php7.3-gd php7.3-json php7.3-mbstring php7.3-mysql php7.3-xml

Check Active PHP Version

After installation verifies the installed and active PHP version using the following command.

php -v

PHP 7.3.6-1+0~20190531112640.39+buster~1.gbp6131b7 (cli) (built: May 31 2019 11:26:40) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.6, Copyright (c) 1998-2018 Zend Technologies
   with Zend OPcache v7.3.6-1+0~20190531112640.39+buster~1.gbp6131b7, Copyright (c) 1999-2018, by Zend Technologies

Congratulation! Enjoy the development with PHP on Debian 10 Buster system.

Share it!
Share on Facebook
Share on Twitter
Share on LinkedIn
Share on Reddit
Share on Tumblr
Share on Whatsapp
Rahul
Rahul
Connect on Facebook Connect on Twitter

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

8 Comments

  1. Avatar Paul Reply
    August 28, 2019 at 10:02 am

    Thanks!

  2. Avatar Eric Reply
    August 25, 2019 at 11:57 pm

    I like this article, the only issue I have is that I dod not wish to remove my index.html – hence I was not able to access the mail login. Do you have any suggestions?

  3. Avatar Zeno Reply
    August 21, 2019 at 3:43 pm

    sudo echo “deb https://packages.sury.org/php/ buster main” | tee /etc/apt/sources.list.d/php.list

    should be

    echo “deb https://packages.sury.org/php/ buster main” | sudo tee /etc/apt/sources.list.d/php.list

    • Rahul Rahul Reply
      August 22, 2019 at 6:56 am

      Thanks Zeno

  4. Avatar Olav Gullaksen Reply
    August 19, 2019 at 4:29 pm

    Hi Rahul,

    Thank you for your efforts here 🙂

    Only missing part when used on Raspbian Buster on a RPi is:

    In your setup PPA third command you need a sudo for the last command:
    sudo echo “deb https://packages.sury.org/php/ buster main” | sudo tee /etc/apt/sources.list.d/php.list

    else you will get an error:
    sudo echo “deb https://packages.sury.org/php/ buster main” | tee /etc/apt/sources.list.d/php.list

    Br, Olav

    • Rahul Rahul Reply
      August 22, 2019 at 6:56 am

      Thanks Olav

      • Avatar intux Reply
        September 1, 2019 at 7:35 pm

        How can I go back to PHP7.3 from Buster when I go this way?
        Thanks for your answer!

        • Avatar Eric Sebasta Reply
          January 24, 2021 at 2:39 pm

          remove everything you find that you installed when you search php7.4 – install the same pacakges ending in php7.3 – restart server.

Leave a Reply Cancel reply

Popular Posts

  • How To Install Python 3.9 on Debian 10
  • How to Install Python 3.9 on CentOS/RHEL 8
  • Download Ubuntu 20.04 LTS – DVD ISO Images
  • Linux Run Commands As Another User
  • How to Check PHP Version (Apache/Nginx/CLI)
  • How To Install and Configure GitLab on Ubuntu 20.04
  • How to Install PyCharm on Ubuntu 20.04
  • How to Check Ubuntu Version with Command or Script
© 2013-2021 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy