How to Setup LAMP (Apache, MySQL, PHP) on Ubuntu 14.04

Today we will learn, how to install & setup LAMP on Ubuntu 14.04(Trusty Tahr). So open your terminal window & Lets start!

So First we need to install Apache Server. In terminal window run following command.

sudo apt-get install apache2


This will install Apache Server on your Ubuntu Desktop. To test it out visit http://localhost or in your browser.

After installing Apache server, it’s turn for MySQL server. To install MySQL server, simple enter following command.

sudo apt-get install mysql-server


This will prompt you for setting up new password for root user. Enter your pass phrase and do next.

At last we will see how to install & setup php. To install php you need to go with this command

sudo apt-get install php5


Above command will install php for you. So we are done for now. Are we really done? No! It’s time to install some php extensions. So type in following command in terminal, it will search for all available php extensions.

sudo apt-cache search php5-*


It will show you the list of php extensions. You can install these in bulk like this

sudo apt-get install name-of-the-extension


Now after that let’s restart apache:

sudo service apache2 restart


And we are done!

Hope this quick tutorial will help you in setting up LAMP stack on your ubuntu desktop. Good Luck!