Install LAMP and phpMyAdmin on Ubuntu 11.10
Page 1 Page 2
LAMP stands for Linux, Apache, MySQL, and php, (or Perl). It's one of the most popular web hosting platforms. If you're developing websites, it's good to have your own private development environment to use while you build and test your websites. This post will show you how to install and configure a LAMP web development environment on Ubuntu 11.10 Oneiric Ocelot to use for testing. It can also be used to set up LAMP on a Virtual Private Server (VPS) or a Dedicated Server, but please note that this post does not cover setting up proper security for serving content to the internet.
Install LAMP
The Ubuntu development team has made it very easy to install and configure a LAMP web server. Open a terminal window and enter the following command.
Please enter the command exactly as it's shown above. The carat (^) is not a typo and the command will not work without it.
If prompted, enter your password.
The package manager will now display a list of packages to be installed. Hit <Enter> to confirm that you want to go ahead with the install.
Apt will now start downloading and installing the packages on your computer.
After a short wait, you will be prompted to set a password for MySQL's administrative user. Enter a password at the prompt and make sure it's something you will remember or make a note of it.
You will then be prompted to confirm your password.
Type in the same password and hit <Enter>. The package manager will now continue downloading and installing packages. After a short wait the installation will complete.
Testing Apache
Now we'll run a quick test to make sure that the Apache web server is working. Open a web browser and enter the address http://localhost/. You should see a page that says "It Works!"
Testing php
Now that we've verified that Apache works, we need to verify that php is working properly. We're going to create a file in the /var/www directory called testing.php. Enter the following command in the terminal to create the file.
Enter your password if prompted.
Now you'll need to restart the Apache web server. Enter into the terminal:
Now open your web browser and enter the following address: http://localhost/testing.php
You should see a web page that displays a bunch of information about your php and Apache environment.
Configure MySQL
Since this is for a local development environment, the MySQL database needs to be bound to the localhost IP address. This should be 127.0.0.1 by default. You can verify your localhost address with the following terminal command.
You should see output something like this:
127.0.0.1 localhost ::1 ip6-localhost ip6-loopback
Now you need to verify that this address is the bind address MySQL's my.cnf file. Use the following terminal command.
You should see output like this.
bind-address = 127.0.0.1
If it's not correct you'll need to edit /etc/mysql/my.cnf as root to fix it.
Page 1 Page 2









Thanks a lot....
hi,
I am trying to have LAMP / server installed on my laptop so I can test php. I followed each of the step and passed all the test above.
When i try to install php web package , it shows blank page.
can you pls advise what went wrong? thanks
i am getting this error every time i try
plz help
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package lamp-server^
E: Couldn't find task 'lamp-server'
E: Couldn't find any package by regex 'lamp-server^'
Thank you !!
thanx for this usefull tutorial
Thank you for this detailed info
For all that I have peformed this install several times over the last 3 years, I STILL forget to leave the asterisk when configuring the phpmyadmin. Thanks for the reconfigure advice or I would have been scratching my head for days; and thanks to them as what take the time to post this install advice which makes my life so easy.
thank you so much for this detailed guide.
)
Much appreciated =)
Really helpful. Thanks a lot
Finally..Ur info was right on. Owe u a beer one day...
Thanks you have done great job
.
I have configure LAMP web development environment successfully. but i am getting a error message in the phpmyadmin. that is as
connection for controluser as defined in your configuration failed.
Thanks
Sorry, I haven't seen that error before. I suggest trying the Ubuntu Forums or phpMyAdmin Forums.
Thank you! Up and running in just a few minutes.
Hi
Thanks for such a detailed tutorial on installing Local AMP on ubuntu 11.10.
I recently moved to ubuntu 11.10 and followed it step by step and it worked like a charm.
Thanks once again.
- Param
Nothing can match the moral boost one gets with Open Source & GPL OS
Got one problem. When I try to make new folder or file in www folder ubuntu error pops up :
" Could not save the file /var/www/newfile.html
You do not have the permissions necessary to save the file. Please check that you typed the location correctly and try again. "
Now if we can not create new folder or file then how can we develop webs in there... lol
any help to mend this issue will be appreciated
.
solution found at http://ubuntuforums.org/showthread.php?t=1694505
to get ownership of directory with command
sudo chown /var/www
DONE!
1. type on terminal -> sudo cp /etc/phpmyadmin/apache.conf /etc/apache2/conf.d
THEN
2. sudo /etc/init.d/apache2 restart
3. WORKS !!!
this is if you can't access http://localhost/phpmyadmin
Thank You! Your instructions worked to a "T". You made the process easy.
Thank a lot for Fixing phpMyAdmin solution
Great info thanks for the sharing