ubuntu

How to install and configure Apache,PHP,MySql and phpMyadmin on ubuntu

51

On Windows Click Here: How to install and configure Apache,PHP,MySql and phpMyadmin on windows

On Linux mint Click Here How to install and configure Apache, PHP, MySql and phpMyadmin on Linux Mint

(UPDATED FOR UBUNTU 12.04 – Precise Pangolin)
Step 1:
Installing apache

Open Terminal. To open terminal click the Dash home from unity launcher. And type terminal in the search field.And click Terminal .

And type the below code in terminal and hit enter.

sudo apt-get install apache2

Type your ubuntu password and press enter.

Type y and hit enter to confirm apache installation.

After the successful installation  , open your favorite browser and type

http://localhost/

in the address bar and press enter. If you will see ‘It works!’ , then your apache works fine.

Step 2:
Installing PHP

Open Terminal. And type the below code in terminal and hit enter.

sudo apt-get install php5 libapache2-mod-php5

Type your ubuntu password if needed.

Type y and hit enter to confirm PHP installation.
After the successful installation restart Apache using the below code

sudo /etc/init.d/apache2 restart

Test PHP installation

To test PHP is installed, Type

sudo gedit /var/www/phpinfo.php

in the terminal and type your ubuntu password if needed. It will open the phpinfo.php file in gedit.Type below code in the phpinfo.php file, save and exit it .

<?php phpinfo() ?>

Now open your favorite browser and type http://localhost/phpinfo.php in the address bar and press enter. If you will see the below page , then your php works fine.

Step 3:
Installing MySql

Open Terminal. And type the below code in terminal and hit enter.

sudo apt-get install mysql-server

Type your ubuntu password if needed.

Type y and hit enter to confirm MySql installation.
During the installation you will be prompted for a password.Choose something secure and type the password and hit enter .

Repeat the password and press enter.

Step 4:
Installing phpMyadmin

phpMyAdmin is a free software tool written in PHP intended to handle the administration of MySQL over the World Wide Web.

Open Terminall. And type the below code in terminal and hit enter.

sudo apt-get install phpmyadmin

Type your ubuntu password if needed.

Type y and hit enter to confirm phpMyadmin installation.

During the installation you will be prompted for a webserver configuration.
Select

apache2

(already selected)
press enter.

Now you will be promped for phpmyadmin configuration

Select

No

and press enter.

Type below command in terminal

sudo cp /etc/phpmyadmin/apache.conf /etc/apache2/conf.d

restart your apache server using

sudo /etc/init.d/apache2 restart

Open your browser and type

http://localhost/phpmyadmin/

in the address bar and press enter.

Type your mysql root  username and password to login.

You’re now ready to start building your local website. just put all of your files into

/var/www
If you enjoyed this article, Get email updates (It’s Free)
avatar
Author :  

Hello visitor! Subscribe to the RSS feed or subscribe via email to receive updates.

Browse related articles

phpMyAdmin 4.0.1 released phpMyAdmin 4.0.1 released

phpMyAdmin 4.0.1 is now available for download.This is a bug fix release.What’s new in this version? Fixes: Import broken for CSV using LOAD DATA When login fails and error display is active, login data is displayed Web server upload directory import fails Server upload folder import file name missing in success message Add retry button [...]

PHP 5.4.15 released PHP 5.4.15 released

PHP 5.4.15 is now available for download.What’s new in this release. Fixes: debug_backtrace in set_error_handler corrupts zend heap: segfault. dns_get_record result with string of length -1. follow_location parameter of context is ignored for most response codes. fd leak on Solaris. fd leak on Solaris. Upgraded libmagic to 5.14. Windows x64 version of stream_socket_pair() and improved [...]

Ubuntu 13.10 (Saucy Salamander) Release Schedule Ubuntu 13.10 (Saucy Salamander) Release Schedule

Ubuntu 13.10 (Saucy Salamander) is scheduled for release in  17th October, 2013 Ubuntu 13.10 Release Schedule: Ubuntu 13.10 Alpha 1 – June 20th,2013 Ubuntu 13.10 Alpha 2 – July 18th,2013 Ubuntu 13.10 Alpha 3 – August 1st,2013 Ubuntu 13.10 Beta 1- September 5th,2013 Ubuntu 13.10 Final Beta – September 26th,2013 Ubuntu 13.10 Release Candidate – [...]

Ubuntu 13.04 Released Ubuntu 13.04 Released

Ubuntu 13.04 (Raring Ringtail) is now available for download. What’s new in ubuntu 13.04? Linux kernel 3.8.8 Unity user interface changes Unity 7 New interface animations, including window snap Scroll-switching of open windows from Unity Launcher New Social Lens Workspace item removed from launcher A new sync menu for Ubuntu One Upstart 1.8 LibreOffice 4.0 [...]

51 Comments on How to install and configure Apache,PHP,MySql and phpMyadmin on ubuntu

  1. [...] on your localhost, you must setup apache and mysql first. We have already posted a tutorial on How to install and configure Apache,PHP,MySql and phpMyadmin on ubuntu.Please read [...]

  2. [...] 7 on your localhost, you must setup apache and mysql first. We have already posted a tutorial on How to install and configure Apache,PHP,MySql and phpMyadmin on ubuntu.Please read [...]

  3. [...] 1.6 on your localhost, you must setup apache and mysql first. We have already posted a tutorial on How to install and configure Apache,PHP,MySql and phpMyadmin on ubuntu.Please read [...]

  4. [...] on your localhost, you must setup apache and mysql first. We have already posted a tutorial on How to install and configure Apache,PHP,MySql and phpMyadmin on ubuntu. Please read [...]

  5. [...] To install phpbb on your localhost, you must setup apache and mysql first. We have already posted a tutorial on How to install and configure Apache,PHP,MySql and phpMyadmin on ubuntu.  Please read first. [...]

  6. avatar Hardy HP says:

    Phpmyadmin installed ok, making directories my_site in var/www ok, but why no text/images displayed when I try to open http://localhost/my_site ?
    Please help.

    Best Regard.

  7. avatar Hardy HP says:

    Once more please,

    I’m still have problems how to configure mysql connected and can be updated fom my php scripts? cause likely mysql still no connected yet. my friend who using other distro recommended to edit httpd.conf in etc/httpd/ but the folder no found in my ubuntu 11.04.

    please help

    Thank

  8. avatar Matt says:

    Thanks a lot! This is exactly what I was looking for… I had made the LAMP installation but phpmyadmin was coming up with a 404 error until I configured it using your instructions. Very helpful article!

  9. avatar CaptHeggie says:

    Hey thanx a lot .. It was really Helpful

  10. avatar sak says:

    Thanks for this man!

  11. avatar German says:

    very usefull, tnx

  12. avatar seafury says:

    Hi Thanks for very helpfull post.

    A question what theme are you using on your ubuntu?

    Thanks.

  13. avatar Hamza Waqas says:

    Thanks mate.. Its works. You made it easy for me to work on LAMP now. :)

  14. avatar babour says:

    Best tutorial on the subject and I have seen a lot of them!

    Thank a lot and great job!

  15. [...] then followed the instructions here  to install Apache, PHP, and MySQL, and that worked smoothly as well.  I installed and was [...]

  16. avatar Mad says:

    This tutorial was complete in all respects, the installation finished like a sweetheart ! Thanks :)

  17. avatar happyfreak says:

    tnx alot – newbie here and this was the thing i’m looking for.. tnx much

  18. avatar GoldenBeast says:

    Thanks Alot !!#23

  19. avatar Rami says:

    you can just include this in apache.conf

    include /etc/phpmyadmin/apache.conf

  20. avatar ALTAiR says:

    Thanx a lot buddies. Very helpgul.
    We did this inside window with the help of Virtualbox on an ubuntu desktop 11.

  21. avatar DrK says:

    I followed the steps blindly but I’m at the last step. What’s my mysql user name and password?

  22. avatar Sam says:

    Thanks for the great tutorial. Thumbs up!..

  23. avatar Harishk says:

    Thank you for tutorial

  24. avatar Mithu Hassan says:

    Thanks for interesting and useful :-)

  25. avatar Rmoorthyk says:

    Thanks

  26. avatar Eric_grego says:

    Very good tutorial!

  27. avatar Ifmartins says:

    It works very well! Thank you

  28. avatar Bichnm says:

    You are simply the best !

  29. avatar Matheus says:

    hey all worked for meee!!! thankssss is my first expirience!!!!! sucess!!!!

  30. avatar Kalicharan Sikarwar says:

    you are really simple and great

  31. avatar Contact says:

    Works great! Highly recommended!

  32. avatar Ladi Oluwa says:

    thanks!

  33. avatar basil2style says:

    really wasome i like it..plz say what is the main use of phmyadmin? Did every1 use it?

  34. avatar puppypark says:

    I use 11.4 …I am too lazy to upgrade

  35. avatar Nagendra says:

    thanks alot yaar..it was very useful post…:)

  36. avatar ahmed ali says:

    Thanks man … i was stuck

  37. avatar shanoj says:

    works fine.really helpfull.thanks alot….

  38. avatar Adrian says:

    Thanks, i have been trying to do this for days!! u really saved me from a lot of headaches

    Thanks once again

  39. avatar Renee says:

    Thanks this was very helpful

  40. avatar siddhartha says:

    it was really helpful for me thank you very much.

  41. avatar Coding-Romy says:

    Wow.. it works!!! Wonderfull!!

  42. avatar Keir says:

    Hi, why do you not select “yes” on the database installation like this guide? http://draalin.com/installing-phpmyadmin-in-ubuntu/

    I am just wondering why.

    Thanks

Leave a Reply