Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Linux Distributions»Debian»How To Install LAMP (Apache, MySQL, PHP) on Debian 8 Jessie

    How To Install LAMP (Apache, MySQL, PHP) on Debian 8 Jessie

    RahulBy RahulMarch 27, 20182 Mins ReadUpdated:November 29, 2019

    Introduction

    A LAMP server is a web server combination of Apache, MySQL, and PHP on Linux server. It is widely used for hosting PHP and MySQL based websites on the world wide web. This tutorial is created to help administrators to configure LAMP-based web hosting environment on Debian Jessie.

    This tutorial helps you to step by step setup of LAMP Stack on a Debian 8 Jessie system.

    Step 1 – Prerequisites

    Login to your Debian system with a sudo privileged user or root user using ssh command. Windows users can either use putty or other alternatives.

    ssh [email protected]
    

    After login to your Debian system upgrade the current packages to the latest available version.

    sudo apt-get update
    sudo apt-get upgrade
    

    Also, install packages on your system required for commands used in this tutorial.

    sudo apt install ca-certificates apt-transport-https 
    

    Step 2 – Install Apache2

    Apache2 packages are available under default apt repositories. You can install Apache2 on a Debian 8 by running below command.

    sudo apt-get install apache2
    

    Step 3 – Install MySQL

    MySQL server packages are also available in Debian 9 base repository. Run below command to install MySQL server for your LAMP setup.

    sudo apt-get install mysql-server
    

    Default repositories don’t contain latest packages. Use this tutorial to install latest MySQL server on Debian 8.

    The installation process will prompt for the root user password.

    Step 4 – Install PHP

    The default Debian repository contained older PHP packages. To install the latest PHP versions enable the below PPA on your System, This provides the latest PHP packages for installation on Debian Linux.

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

    Now install PHP packages on your system. Also install some other required modules to work PHP with MySQL and Apache2.

    apt update
    sudo apt-get install php php-mysql libapache2-mod-php
    

    Step 5 – Verify Setup

    The LAMP installation on Debian 8 has been successfully completed. You can test your setup by creating phpinfo file on your server. Edit the below file in your favorite text editor.

    vi /var/www/html/info.php
    

    Add the below content.

    1
    2
    3
    <?php
      phpinfo();
    ?>

    Now access the info.php file in a web browser using your system IP address.

    debian 8 lamp lamp stack web hosting
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Install Development Tools on Debian 10/9/8
    Next Article How To Install MySQL on Debian 9 (Stretch)

    Related Posts

    How to Install Apache, MySQL, PHP (LAMP Stack) on Ubuntu 22.04

    Updated:June 28, 20225 Mins Read

    How to Create a Sudo User in Debian

    Updated:June 26, 20212 Mins Read

    How To Install XRDP (Remote Desktop) on Debian 10

    4 Mins Read

    Initial Server Setup with Debian 10/9/8

    Updated:June 25, 20214 Mins Read

    How To Install and Configure VNC Server on Debian 10

    Updated:June 26, 20215 Mins Read

    How to Install TeamViewer on Debian 10

    3 Mins Read

    3 Comments

    1. Jimmy Ilenloa on July 18, 2020 11:37 pm

      They no longer have for debian 8. any alternatives

      Reply
    2. ed on September 17, 2019 4:47 pm

      Thank you.. perfect instructions up and running in less than 10 minutes.

      Reply
    3. Pawel Mansfeld on April 15, 2019 1:37 pm

      Rahul thank you. It works on Debian 8 like a charm!

      Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • What is the /etc/nsswitch.conf file in Linux
    • How to Install Ionic Framework on Ubuntu 22.04
    • What is the /etc/hosts file in Linux
    • How to Install Angular CLI on Ubuntu 22.04
    • How to Install Composer on Ubuntu 22.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.