windows

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

55

Step 1:
Installing apache

Download the best available version of Apache web server for Windows from this Download link

Select

Win32 Binary without crypto (no mod_ssl) (MSI Installer)

or

Win32 Binary including OpenSSL

Here we using Apache HTTP Server (httpd) 2.2.17 Win32 Binary including OpenSSL
Double click the installer->Click next->check i accept the terms in the licence agreement and click next->Next->
Now see the below image to fill the server information



Then Click Next->Next->Next->Install->Finish.
If you are finished , 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

Download the latest php version from this Download link
Select VC6 x86 Thread Safe Installer
Here we using php-5.3.3-Win32-VC6-x86
Double click the installer->Click next->check i accept the terms in the licence agreement and click next->Next->
Now see the below image to select the webserver (Apache 2.2.x Module)

Then Click Next->
Select your apache configuration directory.see the below image for the path

The advantage of using the .msi installer is that it will edit and add to the Apache config file for us. In the default Apache 2.2 installation, this will be found at C:\Program Files\Apache Software Foundation\Apache2.2\conf\.

press ok Next-> Next->Install
Click finish to finish the installation.
Restart your apache server,if your are getting any error just restart your pc.

Test PHP installation

To test PHP is installed, Open a simple text editor (like Notepad) and copy/paste below code into it;

<?php phpinfo() ?>

Save as this file phpinfo.php in your Apache Document Root Folder (your home directory)
ie:

C:\Program Files\Apache Software Foundation\Apache2.2\htdocs

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.

If you are getting below error msg during installation

Click ok and then finish.
Open your httpd.conf file in notepad.the default path is

C:\Program Files\Apache Software Foundation\Apache2.2\conf  

And add the following lines to the end of the httpd.conf file:

#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
PHPIniDir "C:/Program Files/PHP/"
LoadModule php5_module "C:/Program Files/PHP/php5apache2_2.dll"
AddType application/x-httpd-php .php
#END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL

Save the file and Restart your apache server, if your are getting any error just restart your pc. And Test you PHP installation.

Step 3:

Installing MySql

Download the latest MySql version from this Download link
Click MySQL Community Server and select Windows (x86, 32-bit), MSI Installer to download.
Here we using MySQL Community Server 5.1.51
Double click the installer->Click next->next->Install->Next->Next->

Next->Next->Next->Next->Next->Next->Next->Next->Next->Next->

If this is your first MySql Database setup, you simply enter your root password.
Click next->Execute->Finish.

Testing MySQL

Open your MySql command line client
To open MySql command line client Go to Start->All programs-> MySql-> MySql server 5.1-> MySql command line client
Type your password and you will get like this

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. phpMyAdmin supports a wide range of  operations with MySQL. The most frequently used operations are supported by the user interface (managing databases, tables, fields, relations, indexes, users, permissions, etc), while you still have the ability to directly execute any SQL statement.

Download the latest phpMyadmin Zip version from this Download link
Here we using phpMyAdmin 3.3.8
Extract the zip archive to this location

C:\Program Files\Apache Software Foundation\Apache2.2\htdocs

And rename the phpMyAdmin-3.3.8-all-languages folder to phpmyadmin. Here 3.3.8 is version number.
Now open your apache httpd.conf file and find these lines

<IfModule dir_module>
DirectoryIndex index.html
</IfModule>

Add index.php after the index.html and it looks like this

<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>

Restart your apache server.Open your browser and type

http://localhost/phpmyadmin/

in the address bar and press enter.

Type username and password to login.

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

PHP 5.4.12 released PHP 5.4.12 released

PHP 5.4.12 is now available for download.Whats new in this release? Fixes: Wrong TSRM usage in zend_register_class alias. get_html_translation_table( output incomplete with HTML_ENTITIES and ISO-8859-1. isset( inconsistently produces a fatal error on protected property. Bad warning text from strpos on empty needle. Use after scope error in zend_compile. Poor efficiency of strtr using array with [...]

phpMyAdmin 3.5.7 released phpMyAdmin 3.5.7 released

phpMyAdmin 3.5.7 is now available for download.This is a bug fix release.What’s new in this version? Fixes: Problem with backslash in enum fields Missing server_processlist.php Safari: white page Correct detection of the Chrome browser Download phpMyAdmin If you enjoyed this article, Get email updates (It’s Free) Tweet Pin It

55 Comments on How to install and configure Apache,PHP,MySql and phpMyadmin on windows

  1. avatar Jimmy Wendelken says:

    It is a wonderful post. I will absolutely be reading this blog more.

  2. avatar Raja Sekhar says:

    Thank you very much

    This page helped me a lot to start with PHP

    - Sekhar

  3. avatar check says:

    Thanks! I finally understood it thoroughly..

  4. avatar Sajesh Mohan says:

    Thank you very much This page helped me a lot to start with PHP

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

  6. avatar ZC says:

    THANK YOUUUU!!!!!! this tutorial is very informative and helped me out a lot!!!!!!!!!

  7. avatar OJ says:

    Hi,
    Your instructions are very lucid and they helped me a lot.
    Although, I am still having problems with testing my PHP Installation.
    I’ve tried both the solutions you gave, with the second one; it’s unable to load that page and with the first one; it gave me an error saying : Error 404..not found

    Your help is highly appreciated.

    • avatar admin says:

      1.Save the phpinfo.php in your Apache Document Root Folder (your home directory) ie: C:\Program Files\Apache Software Foundation\Apache2.2\htdocs
      2.And add the following lines to the end of the httpd.conf file: and restart ur pc ,then test.

      #BEGIN PHP INSTALLER EDITS – REMOVE ONLY ON UNINSTALL
      PHPIniDir “C:/Program Files/PHP/”
      LoadModule php5_module “C:/Program Files/PHP/php5apache2_2.dll”
      AddType application/x-httpd-php .php
      #END PHP INSTALLER EDITS – REMOVE ONLY ON UNINSTALL

  8. avatar Edric says:

    Thank You So much For this tutorial! This tutorial help me a lot. I think this is the easiest one tutorial that i’ve tried :D . Thanks!

  9. avatar Cristian says:

    1) installing apache as service (recommended) it gave me an error saying:
    “(OS 10013) attempt to access the socket in a manner not permitted by their access permissions: make_sock: could not bind to address 0.0.0.0:80
    no listening sockets available, shutting down
    Unable to open logs
    Note the errors or messages above, and press the key to exit.”
    (Google translate :D )
    but the installation has finished anyway.
    2)if I want to install only for the current user,how can I start the service manually?
    3)installing in localhost isn’t a local installation? I mean,if I want to use it in web site,it is fully functional?
    4)can cause problems installing apache in other drives? (I use two partitions,one for windows application and the other for all my stuff,such as my programs)
    P.S. I’m using windows 7 x64 and I recently activated few windows program functions such as IIS…

    …anyway,it’s a good work what you’ve posted!

  10. avatar cristian says:

    Yeah! It was iis on port 80,I have simply modified the httpd.conf file and “It works!” :D Thanks!

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

  12. avatar yassine says:

    Thanks for your help you saved me some precious time fixing a config error with phpmyadmin

  13. avatar floydro says:

    Great tutorial… Had made a few attempts to install apache+php+mysql on windows 7 and i was about to give up. This was my last attempt and it worked flawlessly.

    Thousand thanks!!!!

  14. avatar Abee says:

    You are a life saver, I spent 10 hours trying to figure out what you helped me do in a matter of minutes! Thank you so much!!!!!!

  15. avatar Shreyas says:

    I have installed the server, and it also displays “it works”…
    But I try to open the http://localhost/phpinfo.php , it gives 404 Not Found?
    I tried editing the code in the httpd file, but while re-installing the server, it displays Error(S), in line 4**, something…something…

    And I am firm that the errors are due to adding of the addition codes you provided…because it is specifing the SYNTAX ERROR.
    So what should I do next?

  16. avatar harsh says:

    wen ever i try to restart apache i get a error message “the requested operation has failed..”..weat is d solution for d same..??

  17. avatar firman says:

    thx for your great website, it’s help’s a lot.

  18. avatar Kelly says:

    I’ve been trying to get these working for the past 2 days without luck. I used these instructions and they worked like a charm! I think my problem was that I was trying to use VC9 PHP with VC6 Apache. Thank you!

  19. avatar Kelly says:

    I forgot to mention that my only problem is that it’s not letting me log in – when I use my current Intranet host name or the server name, it says I’m not allowed to connect to this MySQL server. If I just use localhost it says access denied (using the correct password which is 12 characters long (numbers/letters/spec chars). Ideas?

  20. avatar Piyush says:

    Excellent Stuff. One line should be added after Apache and PHP installation that if due to any reasons (eg. due to info from other website etc.) if the insllation is not correct then the installed product should be uninstalled and start a fresh using this page.

    Otherwise it is excellent.

  21. avatar m3trella97 says:

    I’m getting this error message from phpmyadmin.

    The mysqli extension is missing.

    any ideas?

    • avatar admin says:

      try
      1.restart apache server and then pc
      or try
      2.check php.ini for the mysqli extension entry and Uncomment it (if commented), and restart apache

  22. avatar Ali 24x7 says:

    I have been trying to get these working for the past 4 days continuously, but didn’t get success. 
    THANKS TO THIS EXCELLENT WEBSITE, THAT HELPS ME A LOT AND INSTALL ALL APPLICATION WITHOUT ANY ERROR WITH SIMPLE STEPS. THANKS A LOT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :)

  23. avatar safa says:

    while testing php it show error 404..what do i do??

    • avatar connectwww says:

      1.check the url
      2.Save as this file phpinfo.php in your Apache Document Root Folder (your home directory)
      C:Program FilesApache Software FoundationApache2.2htdocs

  24. avatar Albanziu says:

    when I type localhost/phpmyadmin its show

    Etc…

  25. avatar Nitramkamunyu says:

    Hey…
    After installing Apache and testing it; it works!
    After installing php-5.3.13-Win32-VC9-x86
    And creating phpinfo.php in my htdocs
    Not Found

    The requested URL /Program Files (x86)/PHP/php-cgi.exe/phpinfo.php was not found on this server.

    • avatar connectwww says:

      1.check the url
      2.Save as this file phpinfo.php in your Apache Document Root Folder (your home directory)
      C:Program FilesApache Software FoundationApache2.2htdocs

  26. avatar kaiyum says:

    All installation is completed successfully, THANKS so much :)
    BUT .htaccess is not running. What will be the causes…………..

  27. avatar Dennis says:

    Thank you very much, this is very helpful.
    This is my first time to configure php, in this site did, It configured in my owned.

    Thanks a lot…

  28. avatar dhiraj says:

    thanks…. its really good website.

  29. avatar T Khong says:

    Thank you very much. I am looking for this!!!

  30. avatar Danman says:

    Thank you, Thank you, Thank you and Thank you again. If you a lady I would ******* I am so thankful. Been Googling how to properly install PHP like three days non-stop. An geez there are may sites an geeks claiming their way is the best. Out of bout 50 websites an ways of advising how to install PHP…This site is the real thing. “Plain n simple” an simply THE BEST. Thank you again, much appreciated to have someone that keeps it simple straight to the point an NO DEGREE required to get PHP installed. Thanks again n God bless.

  31. avatar Dave says:

    everything went great until i had to add index.php to the httpd file. It said accesss denied amd wouldnt let me save it. ( i am the administrator) so i saved the altered httpd file to the desktop, deleted the one in conf and then replaced it with one onthe desktop. Now I cant restart apache at all

  32. avatar Kungz says:

    Nice tutorial, really help a lot and solve the problem. Thank you very much

  33. avatar Kelvin D souza says:

    Thanks for the post.
    Also I want some details on Mysql and Visual Basic 6.0
    Is it possible to fetch data data from mysql tables and display it or process it in VB

  34. avatar Heartbeat says:

    Sir,
    Actually every thing will work fine, except windows 7.
    what changes will do to install it in windows 7.
    I had followed your instruction but at-last they says that
    unable to change the data present at httpd.inf.

    so pls give a solution

  35. avatar dado says:

    dude thanks :) ) you are great :*

  36. avatar Alfred D'Souza says:

    Hello,
    When I type in the address “http://localhost/phpinfo.php” in the browser I can see the contents of the the PHP page that is “” and not the table as you have shown. Any ideas what I would be doing wrong.

    Thanks and Regards,
    Alfred D’Souza

    • avatar Manikandan says:

      Open a simple text editor (like Notepad) and copy/paste below code into it;

      < ?php phpinfo() ?>

      Save as this file phpinfo.php in your Apache Document Root Folder (your home directory)

    • avatar fegyi001 says:

      I think the problem is that you did not restarted Apache before that.

  37. avatar Bongz says:

    How do I install these on Windows 7?
    Please help, I followed all instructions here and when I tested Apache it works and when I test PHP it doesnt work. I get the error ”The webpage cannot be found”

  38. avatar Prannoy says:

    thanks for the great tutorial/ Everything is fine but i am not able to login in phpmyadmin through the browser. Can you help me with it?

  39. avatar RaviKanth says:

    Thanks for the details provided. Really excellent…………

  40. avatar gong says:

    thanks, for detail tutorial

  41. avatar Nicolás says:

    Thank you very much…

    It has the precise steps to install a WAMP.

Leave a Reply