HOWTO install LAMP on ubuntu feisty fawn
September 1, 2007
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











September 19, 2007 at 8:27 am
Thank you! The LAMP option in the server setup stopped working for me for some reason. Doing it by hand is probably a better idea from a learning standpoint anyway.
September 19, 2007 at 9:14 pm
very nice walk through, best on the web that i have seen
September 27, 2007 at 8:05 am
I have been through every tutorial, website, blog, thread and FAQ and I am still no further forward. All the instructions above I have followed, the browser still tries to open the script via the text editor. I have installed, uninstalled, re-installed and done ALL that ten times over. It ain’t gonna work. Its a spanking new Dell 530. I already have LAMP running on a 1.2Ghz AMD box, no problem. I have checked the apache server and it runs no problem. I have pulled php5 from the repository, mysql is installed I can create databases to they come outta my ears, but I can’t execute a php script… Last chance before I wipe this and put XP Pro on it… 10 days and no success.
October 6, 2007 at 2:21 am
[...] Make a LAMP server by following the instructions on this page: Installing a LAMP server on Ubuntu Feisty Fawn [...]
October 6, 2007 at 10:49 am
@browned off, what exactly is happening on your machine? what errors are you getting?
October 8, 2007 at 1:14 pm
[...] Make a LAMP server by following the instructions on this page: Installing a LAMP server on Ubuntu Feisty Fawn [...]
October 18, 2007 at 3:56 am
I’m having the same problem as “browned off”. When I navigate my browser to a php file on my server, it tries to make me download it instead of executing it.
October 30, 2007 at 7:27 am
[...] http://ubuntuchocolate.wordpress.com/2007/09/01/howto-install-lamp-on-ubuntu-feisty-fawn/ [...]
November 19, 2007 at 6:40 am
phymyadmin is not installing.. Everything else was perfect.
ubuntu 6.06.1 LTS
mj@ub-server:~$ sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
Reading package lists… Done
Building dependency tree… Done
E: Couldn’t find package phpmyadmin
I am confused… everything else was beautiful … clean and fast
November 19, 2007 at 3:27 pm
@MJ King, are you sure you got your sources right? i can still see phpmyadmin in the ubuntu repos, it’s here -> http://packages.ubuntu.com/cgi-bin/search_packages.pl?keywords=phpmyadmin&searchon=names&subword=1&version=gutsy&release=all
November 23, 2007 at 2:06 am
Sources file read:
deb http://us.archive.ubuntu.com/ubuntu/ dapper main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ dapper main restricted
I changed it to:
deb http://us.archive.ubuntu.com/ubuntu dapper main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu dapper main restricted universe multiverse
and got the same error. Suggestions?
Thanks
March 31, 2008 at 4:21 am
nice tutorial, good job
January 20, 2009 at 4:39 am
same happening to me i installed using
sudo apt-get install php5
and
sudo apt-get install apache2
but when try
http://localhost/hello.php ( )
firefox says to download that php file . same happens with other browser
do i hav to start php with any command in terminal?