How to install LAMP on Ubunta 16.04

Ubuntu is a Linux based operating system widely used by programmers to learn programming and developing projects. LAMP stands for Linux Apache MySQL and PHP. In this article, I presume you understand how to work on a website from the back end and how to install software using either the Software Centre or the Terminal. I expect that you have experience running Terminal commands.
Here are the following commands step by step.

Open Terminal ctrl+alt+t, type or copy/paste the following command step by step.

Install apache2

// First update
sudo apt-get update

// This command used to install apache2 server
sudo apt-get install apache2

Install mysql

//This command is used to install latest MySQL server.
sudo apt-get install mysql-server

Install PHP7

// Again update
sudo apt-get udpate

// This command is used to install php7.0 version
sudo apt-get install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi  php7.0 libapache2-mod-php7.0

Install PHPmyadmin

// This command is used to install phpmyadmin on your system
sudo apt-get install phpmyadmin

When you completed all above steps, then copy/paste the following command.

// This command is used to open apache2.conf file in termina, make sure you have 
// installed nano
// If you have not install nano use to following command
sudo apt-get install nano
// Otherwise skip this step

sudo nano /etc/apache2/apache2.conf

Copy/paste the following line of code and place at the end of file ( apache.conf ).

Include /etc/phpmyadmin/apache.conf

Now restart your  apache server.

// This command is used to restart apache2 server
sudo service apache2 restart

Now you can work on your local server.


Be the first to comment