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






[...] 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 [...]
[...] 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 [...]
[...] 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 [...]
[...] 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 [...]
[...] 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. [...]
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.
I just find the answer of my problems using this command
sudo chmod 777 -R /var/www/my_site as like your recommendations in other article at http://connectwww.com/how-to-install-wordpress-on-ubuntu-step-by-step/739/
Thank a lot.
fine
i cant save file www folder
it says there is no permission
change folder permission to 777
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
/etc/apache2/
http://wiki.apache.org/httpd/DistrosDefaultLayout
https://help.ubuntu.com/10.04/serverguide/C/httpd.html
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!
Hey thanx a lot .. It was really Helpful
Thanks for this man!
very usefull, tnx
Hi Thanks for very helpfull post.
A question what theme are you using on your ubuntu?
Thanks.
Bisigi themes
Thanks mate.. Its works. You made it easy for me to work on LAMP now.
Best tutorial on the subject and I have seen a lot of them!
Thank a lot and great job!
[...] then followed the instructions here to install Apache, PHP, and MySQL, and that worked smoothly as well. I installed and was [...]
This tutorial was complete in all respects, the installation finished like a sweetheart ! Thanks
tnx alot – newbie here and this was the thing i’m looking for.. tnx much
Thanks Alot !!#23
you can just include this in apache.conf
include /etc/phpmyadmin/apache.conf
Thanx a lot buddies. Very helpgul.
We did this inside window with the help of Virtualbox on an ubuntu desktop 11.
I followed the steps blindly but I’m at the last step. What’s my mysql user name and password?
root
Thanks for the great tutorial. Thumbs up!..
Thank you for tutorial
Thanks for interesting and useful
Thanks
Very good tutorial!
It works very well! Thank you
You are simply the best !
hey all worked for meee!!! thankssss is my first expirience!!!!! sucess!!!!
you are really simple and great
Thank you
Works great! Highly recommended!
thanks!
really wasome i like it..plz say what is the main use of phmyadmin? Did every1 use it?
I use 11.4 …I am too lazy to upgrade
thanks alot yaar..it was very useful post…:)
Thanks man … i was stuck
works fine.really helpfull.thanks alot….
Thanks, i have been trying to do this for days!! u really saved me from a lot of headaches
Thanks once again
Thanks this was very helpful
it was really helpful for me thank you very much.
Wow.. it works!!! Wonderfull!!
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