Install Apache php phpmyadmin MySql

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)

If you want to host a website on your computer, LAMP (Linux Apache MySql Php) or WAMP  (Windows Apache MySql Php) is the way to go. In addition you would need to install phpmyadmin as well to manage the database. Going for linux based web server is recommended if you are comfortable with it.

Lets first consider the installation on Windows. Installing each component individually and making them talk is quite a challenge. So instead you can install all of it in one go using XAMPP.  Download and install XAMPP. If you select the default options then it would create a folder called htdocs inside folder C:\xampp. This folder would be your root directory for the webserver. You can access its content by typing http://localhost in the web browser. XAMPP has everything you need, even a ftp server and an smtp (mail) server.

Installation all these softwares on linux can be achieved through the corresponding package manager of your distro, e.g. on Ubuntu 9.10 or Debian 5.0 Lenny.

You start by installing mysql

$ sudo apt-get install mysql-client mysql-server

Specify new password for the MySQl “root” user. Repeat it for a second time. Next, install Apache2:

$ sudo apt-get install apache2

Now point your browser to http://localhost, and you should see the Apache2 placeholder page (It works!). To install php do the usual

$ sudo apt-get install php5 libapache2-mod-php5 

To enable php you need to restart apache by

$ /etc/init.d/apache2 restart

To test whether php support is enabled create a php file called info.php, using a text editor of your choice,  with the following content:


Save it in your web-directory and point your browser to it. You should see something like this


To bring in the support for MySql you can install the following packages, if you need for anything more you can search for them by doing sudo apt-get search php5

$ 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 restart apache again, in case you alreadt forgot  /etc/init.d/apache2 restart
Reloading the should show you the mysql related information.

Now finally install phpmyadmin

$ sudo apt-get install phpmyadmin

When asked for “Web server to reconfigure automatically:” select apache2, and you are all set with apache2, php, mysql and phpmyadmin all installed and configured to run your own website, blog, photo gallery and what not.

You might also like

Install Apache MySQL PHP phpmyadmin (LAMP) on Linux Mint 11 Katya Installing...
Install Apache MySQL PHP phpmyadmin (LAMP) on Ubuntu 11.04 Installing...
Install Apache MySQL PHP phpmyadmin (LAMP) on Ubuntu 10.04 or Mint Linux 9 Installing...
Install Apache MySQL PHP phpmyadmin (LAMP) on Linux Mint 13 Maya Installing...

About the Author

has written 346 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.

3 Comments on “Install Apache php phpmyadmin MySql”

  • guven wrote on 14 May, 2010, 10:40

    there is an error this code:
    $ sudo apt-get install php5 libapache2-mod-php

    it need to be:

    $ sudo apt-get install php5 libapache2-mod-php5

    or just install php5. libapache will installed

    Like or Dislike: Thumb up 0 Thumb down 0


  • lifehacker wrote on 15 May, 2010, 9:49

    Thanks for the correction. It has been updated.

    Like or Dislike: Thumb up 0 Thumb down 0



  1. Install Apache php phpmyadmin MySql « Hack Your Life! | Drakz Free Online Service

Write a Comment

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


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