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. After login to your Debian system upgrade the current packages to the latest available version. Also, install packages on your system required for commands used in this tutorial.

Step 2 – Install Apache2

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

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. 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. Now install PHP packages on your system. Also install some other required modules to work PHP with MySQL and Apache2.

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. Add the below content.

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

How To Install LAMP  Apache  MySQL  PHP  on Debian 8 - 5