If you are a web developer proficient in PHP& MySQL, you may be using the popular WAMP Server (Windows, Apache, MySQL and PHP) in your windows platform. The more powerful Linux and Unix platforms have a similar package called LAMP which stands for Linux, Apache, MySQL and PHP and serves the purpose of web development based on Open Source concept. Apache is the Web server, MySQL is the relational database and PHP (Preprocessor Hyper Text) is an object oriented programming language.
There are many approaches to installing LAMP server in Ubuntu 11.04/10.10. The simplest and most likely to be used approach is to use the following command in terminal:
sudo apt-get install lamp-server^
The command initiates the download of LAMP server to your PC with a password prompt and when finished, its done!
Open your browser and type the following:
http://localhost/
and hit enter. If you get the following screen, then Apache definitely works.
To access MySQL, you can use the following URL:
http://localhost/phpmyadmin
The following screenshot depicts PHP Myadmin being explored with your browser.
Finally to test PHP, place a php file (eg: test.php) in your www folder with the following script:
<?php
phpinfo();
?>
Now call the file through your browser by typing http://localhost/test.php
There are other procedures to install LAMP, like using tasksel or installing Apache, MYSQL and PHP separately.

Posted in
Tags: 







[...] This post was mentioned on Twitter by Cellina Minvi, multimediaboom. multimediaboom said: RT @multimediaboom How to install LAMP server in Ubuntu 11.04 / 10.10 / 10.04 http://bit.ly/gnt2MW #lamp #server [...]
hi i just installed
sudo apt-get install lamp-server^ on ubuntu 11.04
but phpmyadmin is not working
http://localhost/phpmyadmin
I then tried to install it with
apt-get install phpmyadmin
but i still get the message in my browser that
404 is not found.
thanks for your help
J
I also got a 404 accessing /phpmyadmin, so tried jan’s suggestion (with an added “sudo” at the start of the command).
During install I got a couple of text prompts regarding database setup, but the DB-users could not be created:
ERROR 1045 (28000): Access denied for user ‘root’@'localhost’ (using password: YES)
Unable to connect to mysql server
A number of retries didn’t solve anything
Well, time to ask Google…
Hello,
Regarding the phpmyadmin not working, here is a simple code to make it run smoothly:
sudo ln -s /usr/share/phpmyadmin /var/www
Simply run this command in your terminal.
Good luck =)
thanks, this worked perfectly!
Thank you, i just want to add (if anyone need it), i had to copy the phpmyadmin folder from usr/share to var/www, and it worked perfectly.
Thanks again.
now ….
after install lamp-server^ you wont get phpmyadmin yet.
you have to “sudo apt-get install phpmyadmin”
so it will install few more modules needed by phpmyadmin (i think mcrypt module)
during the installation process it will ask to configure to which webserver in my case it displayed 2 option a)apache2 and b)lighttpd
now is the most important part!
you have to select apache2 …. by having the cursor beside apache2 then press spacebar. the star “*” sign should appear. only then you’re selecting the apache2.
if you dont do that …. phpmyadmin wont properly configured and most probably wont work.
Hi ismail,
After your post I realized that I never checked the apache2 box with spacebar. So I ran:
sudo apt-get remove phpmyadmin
and attempted to remove the tool so that I could re-install (and reconfigure) it. However, when installing it again, I don’t get the option to choose apache2, it accepts the previous parameters I entered…
Any ideas?
Try:
apt-get –purge remove phpmyadmin
this will remove and purge all configurations
next reinstall phpmyadmin
i installed and had the same error.but then i used the fix
ln -s /usr/share/phpmyadmin /var/www
as suggested by Qusai.and phpmyadmin now works
but i cannot create a database, it says insufficient privileges
What is the importance of ^ in sudo apt-get intall lamp-server^ ??
I can’t simply write sudo apt-get intall lamp-server .
hi i am trying to host something using php support and mysql databases both of them i can not seem to get to work any advice email me at jackbrown1941@live.co.uk
and p.s u may have to run it in the browser u could run through terminal with root priveliges if that works by the way jan
Hi, followed the above instructions but I get
‘Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.’
when I try and log into phpmyadmin – any clues where I should go to solve this one?
[...] Reference ubuntu 下架设LAMP+phpmyadmin Installing Apache2 With PHP5 And MySQL Support On Ubuntu 11.04 (LAMP) How to install LAMP server in Ubuntu 11.04 / 10.10 / 10.04 [...]
i am also getting the same thing … not able to resolve
yeah its really work…
bruno reply is perfect
Quite easy, and actually working.
Thanks for the tut!
go to Synaptic and search for phpmyadmin. And make sure you have put a password in it.
i just installed ubuntu 11.04 today and installed lampp from apachefriends… question…how do i start lamp… if i installed it on a different drive? i couldn’t install or move the extracted archive to the opt folder? it tells me i’m not the owner
sorry… my first time to be on linux.. and trying to find my way through… any help would be much appreciated
I followed above instructions but its shows 404 page notfound …
sir i gv d command in terminal sudo apt-get install lamp-server^
and due to some problem i press ctrl+z
and again when i try to install i m getting this error
E: Could not get lock /var/lib/dpkg/lock – open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
pls help me what to do .
and how i can install lamp in my ubuntu11.04
thanx in advnc
did u try sudo apt-get remove lamp-server^
after installation how can i add file in www folder . and also getting 403 error when i m going to access http://localhost/phpmyadmin
getting this error
Forbidden
You don’t have permission to access /phpmyadmin on this server.
Apache/2.2.17 (Ubuntu) Server at localhost Port 80
Hi I cannot save the test.php file to the www folder. It says I do not have to permission to save to that location.
Any ideas?
do u accesing var/www from through terminal and just do and will ask you your password then u can access var/www and you can save but only through terminal
Hey there peeps.
Just want to say. As a new Linux user, I think I just had the best computing experience in my life
.
Using this guide has made it easy to install anything in this world!
I hope Linux over takes the miserable world of windows.
Linux will become the future!!
Ismail Muchas gracias.
@Cohen you need to do: sudo gedit test.php to create and save the file with the right permissions.
For those having problems immediately after installing phpmyadmin and still get an error when they visit http://localhost/phpmyadmin the solution is that you need configure apache to recognize the phpmyadmin gui you installed. So complete the installation of phpmyadmin under Apache2, add the following line in the Apache configuration file at /etc/apache2/apache2.conf Include /etc/phpmyadmin/apache.conf (preferably at the end of that file where you’ll find other Include syntaxes)… Then restart apache by doing: sudo /etc/init.d/apache2 restart
Voila.. Hope it helps
Thanks man
sudo apt-get install lamp-server^
http://localhost/
http://localhost/phpmyadmin
i have run all this things after running test.php i got all the information about server nd all
but in terminal i done and im accessing mysql through root in terminal
but im getting error as
“ERROR 1045 (28000): Access denied for user ‘root’@'localhost’ (using password: NO)
”
Please help me to come out through it
Hey even i am faceing the same problem. Have you found the solution to solve this problem.
I’ve installed LAMP on Ubuntu before, but I had help through it. Afterwards, we had to work on creating a website, server, e-mail system, blah blah balh, all for a grade in class. Quite confusing, yet even more boring.
Anyway, we’re taking a test and I’m trying to practice before tomorrow. I’ve got Ubuntu up and running, but when I try to install the LAMP server — sudo apt-get install lamp-server^ — it tells me it can’t find any of the packages or tasks. The first time I did this, I didn’t have this problem. Now that I have a test to do, I’m quite confused. Since we can’t ask for help, I’m basically screwed…
Any help on this matter will be much appreciated!~
Hi, I am learning to program C in college and this works perfectly for me. Thanks a lot for your help!
Thanks for all the great help. Very very useful.
invoke-rc.d: initscript mysql, action “stop” failed.
dpkg: error processing mysql-cluster-server-5.1 (–remove):
subprocess installed pre-removal script returned error exit status 1
No apport report written because MaxReports is reached already
* Stopping MySQL database server mysqld [fail]
invoke-rc.d: initscript mysql, action “stop” failed.
During installation i am getting the following errors;;
kindly help
Do you want to continue [Y/n]? y
Preconfiguring packages …
(Reading database … 288053 files and directories currently installed.)
Removing mysql-cluster-server-5.1 …
* Stopping MySQL database server mysqld [fail]
invoke-rc.d: initscript mysql, action “stop” failed.
dpkg: error processing mysql-cluster-server-5.1 (–remove):
subprocess installed pre-removal script returned error exit status 1
No apport report written because MaxReports is reached already
* Stopping MySQL database server mysqld [fail]
invoke-rc.d: initscript mysql, action “stop” failed.
* Starting MySQL database server mysqld [ OK ]
dpkg: mysql-cluster-client-5.1: dependency problems, but removing anyway as you requested:
mysql-cluster-server-5.1 depends on mysql-cluster-client-5.1.
Removing mysql-cluster-client-5.1 …
Processing triggers for man-db …
Processing triggers for libc-bin …
ldconfig deferred processing now taking place
Errors were encountered while processing:
mysql-cluster-server-5.1
N: Ignoring file ‘obs-ostinato.sources.list’’ in directory ‘/etc/apt/sources.list.d/’ as it has an invalid filename extension
E: Sub-process /usr/bin/dpkg returned an error code (1)