as a webdeveloper this was my first priority to install. a lot of people say that linux is hard to use, but installing lamp on an ubuntu installation is not hard at all, it’s a heck lot easier than installing in windows, lesser ticks and tacks to make it work. once installed, you’ll be confident that it’s gonna run properly.

so what is lamp? it is Linux Apache MySQL and PHP.

Installing LAMP On Ubuntu For Newbies | HowtoForge – Linux Howtos and Tutorials

Update your Sources

sudo apt-get update

Install Apache and PHP5
in the terminal

sudo apt-get install apache php5 libapache2-mod-php5

Refresh Apache then try it on
again, nowhere else

sudo /etc/init.d/apache2 restart

then in your browser open this address

 http://localhost/

and if you have your machine on a local network try this address on another computer in the same network.

http://{your_machine_name}/

Try PHP too
create a php file, in your terminal

gksudo gedit /var/www/test.php

copy and paste this in the newly opened gedit

<?php phpinfo(); ?>

now open it up in your web browser

http://localhost/testphp.php

Install MySQL
once again in the terminal

 sudo apt-get install mysql-server

to allow other computers in the network to get access to mysql, edit my.cnf

gksudo gedit /etc/mysql/my.cnf

and change this line, using your ip address

bind-address = 127.0.0.1

Set MySQL password 

mysql -u root

the prompt should change to mysql>, then enter the following

SET PASSWORD FOR ‘root’@'localhost’ = PASSWORD(‘yourpassword’);

Install PHPMyAdmin
this is a great tool for managing databases, it’s web based, so you’ll be using the web browser with this one.

sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin

and now to make PHP work with MySQL

gksudo gedit /etc/php5/apache2/php.ini

look for this line, and remove the semicolon.

;extension=mysql.so

Again, refresh Apache, then your Done.

sudo /etc/init.d/apache2 restart