ubuntu

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

38

Professional budget Web hosting starts from $2.00. Cpanel -Control Panel,Softaculous -Auto Script Installer.PHP and Mysql.RVSkin

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

20% lifetime off - Tekecho Web hosting

avatar
Author :  

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

Browse related articles

How to enable auto login in Ubuntu 12.04 How to enable auto login in Ubuntu 12.04

Professional budget Web hosting starts from $2.00. Cpanel -Control Panel,Softaculous -Auto Script Installer.PHP and Mysql.RVSkin To enable auto login in Ubuntu 12.04 1.Open system settings.To open system settings, click the Dash home from unity launcher.And type system settings in the search field. And click system settings. 2.Click User Accounts. 3.Then click Unlock button and type [...]

How to install conky on ubuntu How to install conky on ubuntu

Professional budget Web hosting starts from $2.00. Cpanel -Control Panel,Softaculous -Auto Script Installer.PHP and Mysql.RVSkin Conky is a free, light-weight system monitor for X, that displays any information on your desktop as text, or using simple progress bars and graph widgets, with different fonts and colours. To install conky on ubuntu 1.Open Terminal.To open terminal [...]

How to install Cinnamon desktop environment on ubuntu How to install Cinnamon desktop environment on ubuntu

Professional budget Web hosting starts from $2.00. Cpanel -Control Panel,Softaculous -Auto Script Installer.PHP and Mysql.RVSkin Cinnamon is a free desktop environment from Linux Mint.It looks like a traditional GNOME 2 desktop but it is based on the modern GNOME Shell. To install Cinnamon desktop environment on ubuntu 1.Open Terminal.To open terminal click the Dash home [...]

How to install bluefish on ubuntu How to install bluefish on ubuntu

Professional budget Web hosting starts from $2.00. Cpanel -Control Panel,Softaculous -Auto Script Installer.PHP and Mysql.RVSkin Bluefish is free text editor with many tools for development of dynamic websites.It supports many programming and markup languages. Bluefish supports HTML, XHTML, CSS, XML, PHP, C, C++, JavaScript, Java, Google Go, Vala, Ada, D, SQL, Perl, ColdFusion, JSP, Python, [...]

  • Pingback: How to install wordpress on ubuntu (step by step) | CONNECTwww.com

  • Pingback: How to install Drupal 7 on ubuntu | CONNECTwww.com

  • Pingback: How to install Joomla 1.6 on ubuntu | CONNECTwww.com

  • Pingback: How to install MediaWiki on ubuntu | CONNECTwww.com

  • Pingback: How to install phpbb on ubuntu | CONNECTwww.com

  • Hardy HP

    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.

  • Hardy HP

    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

  • http://mattwatson.ws Matt

    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!

  • CaptHeggie

    Hey thanx a lot .. It was really Helpful

  • sak

    Thanks for this man!

  • German

    very usefull, tnx

  • seafury

    Hi Thanks for very helpfull post.

    A question what theme are you using on your ubuntu?

    Thanks.

    • admin

      Bisigi themes

  • Hamza Waqas

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

  • babour

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

    Thank a lot and great job!

  • Pingback: Ubuntu 11 | sjsmoto's space

  • Mad

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

  • happyfreak

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

  • GoldenBeast

    Thanks Alot !!#23

  • Rami

    you can just include this in apache.conf

    include /etc/phpmyadmin/apache.conf

  • ALTAiR

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

  • DrK

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

    • admin

      root

  • Sam

    Thanks for the great tutorial. Thumbs up!..

  • Harishk

    Thank you for tutorial

  • http://xeeme.com/mithuhassan Mithu Hassan

    Thanks for interesting and useful :-)

  • Rmoorthyk

    Thanks

  • Eric_grego

    Very good tutorial!

  • Ifmartins

    It works very well! Thank you

  • Bichnm

    You are simply the best !

  • Matheus

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

  • Kalicharan Sikarwar

    you are really simple and great