Install Apache MySQL PHP phpmyadmin (LAMP) on Ubuntu 10.04 or Mint Linux 9

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)
Loading ... Loading ...

Installing Apache MySQL, PHP and phpmyadmin on Ubuntu 10.04 lucid lynx or Mint Linux 9 is far easier and less complicated than doing the same on Fedora 13, (my own experience).

Update: As pointed out by Donovan (thanks for the info), you can install Apache2, php, MySQL all in one shot using the following command:

sudo tasksel install lamp-server

However, you would still need to install additional php libraries and phpmyadmin, as described in steps 4 and 5 below.

Original Tutorial

Step 1: You start by installing mysql

sudo apt-get install mysql-client mysql-server

Specify new password for the MySQl “root” user when prompted. Repeat it for a second time and you would have MySQL server and client installed.

Step 2: Next, install Apache2:

sudo apt-get install apache2

And you get apache2 installed as well. To double check, point your browser to http://localhost, and you should see the Apache2 placeholder page like this.

Step 3: To install support for PHP, do the usual

sudo apt-get install php5 libapache2-mod-php5

To verify that everything installed correctly and php support is enabled, you need to restart apache by doing this

sudo /etc/init.d/apache2 restart

Create a test php file called info.php, using a text editor of your choice (say gedit)

sudo gedit /var/www/info.php

and paste the following content and save the file

<?php
phpinfo();
?>

Now open the following page http://localhost/info.php and you should see something like this

Step 4: To make MySQL,  php and apache talk among themselves, you would have to install php5-mysql, below I am listing some more useful packages that you might want to install

sudo apt-get install php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-json

Now refresh the info.php page that you have open in your browser and you should be able to see the support for mysql if you search for it by doing Ctrl+f, but before that don’t forget to restart apache again (sudo /etc/init.d/apache2 restart)

Step 5: Finally install phpmyadmin

sudo apt-get install phpmyadmin

It would ask if you want to configure it automatically for apache or lightppd choose apache and press Ok. It would be automatically configured, it would also ask for  configuring database, choose yet and on next screen you would be asked to enter the MySQL root password, next it would ask you to enter a password to be used by phpmyadmin to register with the database (basically it would create a user called “phpmyadmin” the password is for that. You can even choose to assign a random password for it. Once you have made your choice the installation would finish

and you should be able to access phpmyadmin by pointing your web browser to http://localhost/phpmyadmin/

You might need to restart apache again, for the above link to start working!

See how easy it was!

If you found this useful, please consider leaving a comment or liking us on Facebook or following us on Twitter or subscribing to the RSS feed to have future articles delivered to your feed reader.

You might also like

Install Apache MySQL PHP phpmyadmin (LAMP) on Linux Mint 11 Katya Installing...
Install Apache MySQL PHP phpmyadmin (LAMP) on Linux Mint 13 Maya Installing...
Install Apache MySQL PHP phpmyadmin (LAMP) on Ubuntu 11.04 Installing...
Install Apache php phpmyadmin MySql If you want...

About the Author

has written 1285 posts on this blog.

Meditating towards his "nerdvana", lifehacker is a teacher by the day and a nerdy blogger by the night. He lives to learn and yearns to learn living.

46 Comments on “Install Apache MySQL PHP phpmyadmin (LAMP) on Ubuntu 10.04 or Mint Linux 9”

  • MrNiceGuy wrote on 20 June, 2010, 7:20

    Very nice. Thank you!

    Well-loved. Like or Dislike: Thumb up 5 Thumb down 0

    [Reply]

  • Felipe Butcher wrote on 23 June, 2010, 10:24

    Great documentation we have here. Clean and straightforward. Thank you!

    Well-loved. Like or Dislike: Thumb up 5 Thumb down 0

    [Reply]

  • nobles wrote on 26 June, 2010, 13:44

    Well done. I have mission to get-her-done, and you have made that task faster and easier. Thanks for the time you put in this article.

    Like or Dislike: Thumb up 3 Thumb down 1

    [Reply]

  • lifehacker wrote on 26 June, 2010, 20:23

    Most welcome guys, glad to help out the community.

    Like or Dislike: Thumb up 1 Thumb down 0

    [Reply]

  • Kenny wrote on 30 June, 2010, 12:31

    I installed everything… Great tutorial…

    However, when I went to access http://localhost/phpmyadmin it is not found… So I am not sure what happened. If you could offer any suggestions I would appreciate it.

    Thanks again for your straight forward tutorial.

    Like or Dislike: Thumb up 2 Thumb down 1

    [Reply]

  • lifehacker wrote on 30 June, 2010, 14:01

    @Kenny
    Did you restart apache2 after installing phpmyadmin by doing

    sudo /etc/init.d/apache2 restart

    See if that fixes your problem.

    Also, did you get the option to automatically configure phpmyadmin for apache2? If not, then uninstall phpmyadmin and try installing it again and see if you get the option to configure it.

    Like or Dislike: Thumb up 1 Thumb down 0

    [Reply]

  • Kenny wrote on 2 July, 2010, 13:21

    I figured out what I did wrong… I did not press the space bar to select apache2 for the auto config. I also had to create a “fake shortcut” because phpmyadmin was installed in another folder.

    I am very new to all of this so I am unfamiliar with the correct terms to use. But I look forward to learning more and I am very thankful for the large community always offering their help and advice such as yours.

    Thanks.

    Like or Dislike: Thumb up 2 Thumb down 1

    [Reply]

  • immorality_boy wrote on 11 July, 2010, 6:44

    thanks for this great tutorial,,
    can i put this tutorial in my own blog? i will write the source…
    thank you very much!

    Like or Dislike: Thumb up 0 Thumb down 1

    [Reply]

  • lifehacker wrote on 11 July, 2010, 14:00

    @immorality_boy
    Feel free to use it on your blog. Just acknowledge the original author and the website.

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • Shawn P wrote on 15 July, 2010, 12:39

    I just wanted to say THANK-YOU! I was having the hardest time figuring out how to install all this on Ubuntu. I’m a Windows turned Mac user (for last 4 years) and I just made the jump to use Linux for testing websites locally. So, THANKS!

    Like or Dislike: Thumb up 2 Thumb down 0

    [Reply]

  • Luis Cosio wrote on 19 July, 2010, 1:20

    For those having issues with phpmyadmin, just run this command:

    sudo ln -s /usr/share/phpmyadmin phpmyadmin

    Like or Dislike: Thumb up 3 Thumb down 0

    [Reply]

    Mike McNeil Reply:

    @Luis Cosio, Yep that’s it.  Thanks.

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • Andrés Richero wrote on 20 July, 2010, 8:25

    Thanks for this great tutorial

    Like or Dislike: Thumb up 2 Thumb down 0

    [Reply]

  • zawzaw wrote on 1 August, 2010, 1:52

    Hi
    I got 404 error on phpmyadmin page.
    I tried to remove phpmyadmin using apt-get remove/autoremove.
    But I couldn’t get back autoconfigure options when reinstal.
    help, pls

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • zawzaw wrote on 1 August, 2010, 2:01

    Sorry,
    I got it complete remove and get options back using
    #apt-get remove –purge package
    #apt-get clean
    thanks,
    great tutorial!

    Like or Dislike: Thumb up 1 Thumb down 0

    [Reply]

  • lifehacker wrote on 1 August, 2010, 12:01

    @zawzaw
    Glad to hear that you resolved it yourself, before I got to look at it.

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • brunoferreira wrote on 23 August, 2010, 11:10

    I’m using linux 10.04 on a 64 platform. Is there any incompatibility between phpmyadmin with this version of linux (64 bits ). I can’t get the phpmyadmin page loaded on the browser. I’ve read all the posts above and done all but the unsinstalling and reinstalling thing that someone tried. I didn’t take the chance as the person said it didn’t give the option to autoconfig after reinstallation.

    I occurred to me that the issue might have to do with the fact that I am using a 64-bit linux, but I am very fresh using Linux and can be saying something completely wrong here. Anyway, It’s just a hit for you geeks to try to help me out.

    I’m striving to scape from using Windows 7, so please help me to join in your linux world. I will be eternally thankful.

    Regards from Rio de Janeiro – Copacabana lol – Brazil

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • brunoferreira wrote on 23 August, 2010, 11:17

    sorry for the typos below, but I’m very impatient to write.

    Guys, as far as I can say, I am restarting the server properly, the info.php page is loading properly. I followed the steps to configure phpmyadmin and set the password for the db.
    I can see all the php5 extensions installed in the info page, but I cannot say whether I have my database installed, for sure. This is not like windows that I can go in the folder and check it out. I am quite puzzled with the differences here in the linux setting.

    Help me to get into the linux world for once. I am suffering by having to rely on windows.

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • lifehacker wrote on 23 August, 2010, 11:42

    @brunoferreira – 32 bit vs 64 bit should not be causing any problems. But I would have to double check it myself. I do not have access to my 64 bit Ubuntu 10.04 installation right now. But I can get back to you with the solution by evening EST. If you haven’t figured it out by yourself.

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • lifehacker wrote on 23 August, 2010, 22:22

    @brunoferreira
    I am surprised why are you facing problems. I checked it on my 64 bit Ubuntu and it works fine.

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • Ignas wrote on 25 August, 2010, 12:46

    Just great, tnx once again :)

    Like or Dislike: Thumb up 1 Thumb down 0

    [Reply]

  • brunoferreira wrote on 26 August, 2010, 23:43

    lifehacker. It can be my own fault, maybe. I am brand new to Linux. Anyway, is there a set of procedures that I can follow as to uninstall the phpmyadmin and reinstall it. I am thinking the rest of the installations are all working fine, so I should just reinstall the phpmyadmin.

    I will draw extra attention to the steps you advise me to follow, so that I don’t mess it up, just as I may have already been doing lol.

    I’m looking forward to hearing from you. Also, hoping to finish it so I don’t neeeeeeed windows anymore.

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • brunoferreira wrote on 26 August, 2010, 23:50

    it just came to me that I may have had a conflict of ports. Is there a way for me to set the phpmyadmin port to a number different of 80 ? Maybe it works.

    Maybe I already have another server installed here ( which I don’t know ) that is already using the port 80, which is the default port used my phpmyadmin, isnt it ?

    lol

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • lifehacker wrote on 27 August, 2010, 11:06

    @brunoferreira – phpmyadmin is just a php script that communicates with MySQL, so the port involved here is that of your webserver, i.e. apache. So I am not sure what is the exact nature of your problem. You can remove phpmyadmin by doing this

    sudo apt-get remove phpmyadmin

    or
    Use Synaptic to uninstall phpmyadmin and chose “Remove completely”.

    Try reinstalling and see if that works for you.

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • lifehacker wrote on 27 August, 2010, 11:09

    @brunoferreira
    Actually use this command instead, it would be more effective

    sudo apt-get purge phpmyadmin

    it would ask you to deconfigure the database for phpMyAdmin. Hope it helps.

    Like or Dislike: Thumb up 2 Thumb down 0

    [Reply]

  • ennki wrote on 1 September, 2010, 12:50

    Uff hay mucho que aprender en linux y creo que este es un excelente lugar para aprender =]
    Gracias por compartir tus conocimientos, sigue adelante.

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • lifehacker wrote on 1 September, 2010, 14:31

    @ennki
    Usted es la mayoría de la recepción. Dar linux algún tiempo y te encantará.

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • ennki wrote on 1 September, 2010, 21:28

    I had trouble at the end when i tried to get access to phpMyAdmin, the error: “Not Found The requested URL /phpmyadmin/ was not found on this server“.
    I did uninstall and reinstall three times and i got the same error, so googling i found this command: echo “Include /etc/phpmyadmin/apache.conf” | sudo tee -a /etc/apache2/apache2.conf, and its worked.
    Sorry for my english =P!!

    Like or Dislike: Thumb up 1 Thumb down 0

    [Reply]

    lifehacker Reply:

    I guess there must have been some mistake on your part in configuring phpmyadmin for apache2, else it is all quite straight forward.

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • ranji wrote on 5 September, 2010, 13:05

    i installed php,mysql,apache as it is told here… but i got this error,

    Not Found

    The requested URL /phpmyadmin/ was not found on this server.
    Apache/2.2.14 (Ubuntu) Server at localhost Port 80

    what should i do further?
    i got the same response in each step as in this site.. i think the error must be from phpmyadmin installation…..

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • lifehacker wrote on 5 September, 2010, 18:42

    @ranji – Look two comments below: the comment by ennki, that might solve your problem. By the way did you get option to auto configure apache2 for phpmyadmin? And did you restart apache2 after phpmyadmin installation?

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • tikko wrote on 11 September, 2010, 21:29

    Thanks, brother.

    Simple , to the point and clear!!

    Like or Dislike: Thumb up 1 Thumb down 0

    [Reply]

  • Donovan Acree wrote on 15 September, 2010, 13:56

    Why not just run
    sudo tasksel install lamp-server

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

    lifehacker Reply:

    Thanks for the info, this command installs apache2, mysql and php. You would still need to install phpmyadmin separately.

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • Roman Beidnitz wrote on 27 September, 2010, 11:36

    An realy good FAQS for installing manually your Lamp server, work fine for me!

    greez

    Like or Dislike: Thumb up 1 Thumb down 0

    [Reply]

  • Ankit Sharma wrote on 14 October, 2010, 6:42

    Yes, Apache needs to be restarted again after the installation, Seems like a problem with Ubuntu 10.04

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • Sasa wrote on 19 October, 2010, 11:06

    Thanks a lot, mate. Though i had the same problem with phpmyadmin as mentioned above.

    As far as i understood, the problem was that i didn’t marked ‘apache2′ option properly with space-bar and hit Enter.

    After being reinstalled it seems to work perfectly.

    Like or Dislike: Thumb up 2 Thumb down 0

    [Reply]

  • chris wrote on 11 November, 2010, 22:22

    Two things for newb users to read before setting up php and mysql!

    1) You have to choose *apache* by highlighting it AND then pushing the SPACEBAR in the “sudo apt-get install phpmyadmin” prompts.
    (Don’t just highlight apache and move on to the next step without hitting the spacebar. Would’ve been nice if that step was explained in this near-perfect installation guide).

    2) After phpmyadmin is installed, your username is “root” and the password is “(whatever you created in the phpmyadmin prompts)”.

    Well-loved. Like or Dislike: Thumb up 5 Thumb down 0

    [Reply]

  • Simone wrote on 17 December, 2010, 13:13

    Note for the others with my problem (solved)

    I installed lamp-server with the tasksel method in linuxmint 10 on an asus eeepc 1001px, and for reasons i don’t know, it failed to install tha php5 package.

    The result was that apache was unstartable after reboot.

    I purged everything (cause i hadn’t any idea hy the problem came) then reinstalled via tasksel, added by hand php5 and the other packages (section 4 and 5 of the guide).

    Now, after several reboots, everything is ok.

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

    lifehacker Reply:

    Thank you for sharing it with us. Tasksel has always worked for me, but then sometimes things don’t work the way they are supposed to.

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • Jerome wrote on 9 January, 2011, 20:20

    Great job making the task of installing Apache-MySql-Php on my Ubuntu 10.04 dualb machine easy and trouble-free! Thanks.
    Jerome.

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

  • Mohammad wrote on 17 February, 2011, 14:30

    hi guys, very good post!
    i misconfigured phpmyadmin and now, i see 404 Not found, on this url: 127.0.0.1/phpmyadmn

    i tried to remove phpmyadmin by this command: sudo apt-get remove phpmyadmin

    then, i install it by this command: sudo apt-get install phpmyadmin

    but, i did not see the window you told, to configure the phpmyadmin.

    please help me to remove & install new phpmyadmin, and then following the tutorial.

    regards

    Like or Dislike: Thumb up 1 Thumb down 0

    [Reply]

  • Croyd wrote on 12 April, 2011, 8:22

    Great tutorial, worked like a charm once I read you have to hit space to make sure apache2 was selected for phpmyadmin.

    Thank you.

    Like or Dislike: Thumb up 0 Thumb down 0

    [Reply]

Trackbacks

  1. Install Apache MySQL PHP dan PHPMyAdmin di Linux « Misteryfan's Blog
  2. Installed Apache on the Ubuntu | Vladimir Peregoncev – Web Site
  3. Install Apache MySQL PHP phpmyadmin (LAMP) on Ubuntu | TurboLinux Blog

Write a Comment

Gravatars are small images that can show your personality. You can get your gravatar for free today!

*

Copyright © 2014 Hack Your Life!. All rights reserved.
Proudly powered by WordPress. Developed by Deluxe Themes