How to install LAMP server in Ubuntu 11.04 / 10.10 / 10.04

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.

You can leave a response, or trackback from your own site.

SUBSCRIBE TO OUR DAILY RSS FEED!

RELATED POSTS

9 Responses to “How to install LAMP server in Ubuntu 11.04 / 10.10 / 10.04”

  1. […] 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 […]

  2. jan says:

    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

    • Sarauw says:

      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…

    • Qusai says:

      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 =)

  3. ismail says:

    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.

    • blyde says:

      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?

      • Bruno says:

        Try:

        apt-get –purge remove phpmyadmin

        this will remove and purge all configurations

        next reinstall phpmyadmin

  4. dan says:

    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

  5. Ankit says:

    What is the importance of ^ in sudo apt-get intall lamp-server^ ??
    I can’t simply write sudo apt-get intall lamp-server .

Leave a Reply

Popup By Puydi