Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at: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

    By RahulNovember 29, 20192 Mins Read

    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.

    Advertisement

    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

    Related Posts

    Using the Apt Package Manager on Debian-based Systems

    How to Install LAMP Stack on RHEL & CentOS Stream 9

    How to Setup DKIM (DomainKeys) with Postfix

    A Step-by-Step Guide to Installing OpenDKIM with Postfix on Ubuntu – Unleash the Power of DKIM!

    View 3 Comments

    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

    Advertisement
    Recent Posts
    • Implementing a Linux Server Security Audit: Best Practices and Tools
    • cp Command in Linux (Copy Files Like a Pro)
    • 15 Practical Examples of dd Command in Linux
    • dd Command in Linux (Syntax, Options and Use Cases)
    • Iptables: Common Firewall Rules and Commands
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

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