windows

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

29

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

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.

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

PHP 5.4.3 released PHP 5.4.3 released

Professional budget Web hosting starts from $2.00. Cpanel -Control Panel,Softaculous -Auto Script Installer.PHP and Mysql.RVSkin PHP 5.4.3 is now available for download. Fixed Buffer Overflow in apache_request_headers (mod_php and php-fpm are not vulnerable to this attack) Fixed Improve fix for PHP-CGI query string parameter vulnerability (PHP 5.3 series is not vulnerable to  this issue) Download [...]

PHP 5.4.2 released PHP 5.4.2 released

Professional budget Web hosting starts from $2.00. Cpanel -Control Panel,Softaculous -Auto Script Installer.PHP and Mysql.RVSkin PHP 5.4.2 is now available for download. Fixed PHP-CGI query string parameter vulnerability.(unnoticed for at least 8 years).If you are using Apache mod_cgi to run PHP you may be vulnerable. To see if you are, just add ?-s to the [...]

Twitter sponsoring Apache Foundation Twitter sponsoring Apache Foundation

Professional budget Web hosting starts from $2.00. Cpanel -Control Panel,Softaculous -Auto Script Installer.PHP and Mysql.RVSkin Twitter announced that it has become an official sponsor of the Apache Software Foundation (ASF), a non-profit and volunteer-run open source foundation. ASF was originally founded in 1999 to support the development community behind the Apache Web server. Source 20% [...]

Windows 8 Editions revealed Windows 8 Editions revealed

Professional budget Web hosting starts from $2.00. Cpanel -Control Panel,Softaculous -Auto Script Installer.PHP and Mysql.RVSkin Microsoft has announced the Windows 8 Edition names. Windows 8 and Windows 8 Pro – For PCs and tablets powered by x86 processors (both 32 and 64 bit). Windows RT – For ARM processors. Windows 8 Enterprise – For enterprise [...]

  • http://www.inseasonsports.com/jets-namath-and-super-bowl-iii/ Jimmy Wendelken

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

  • http://none Raja Sekhar

    Thank you very much

    This page helped me a lot to start with PHP

    - Sekhar

  • check

    Thanks! I finally understood it thoroughly..

  • Sajesh Mohan

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

  • Pingback: How to install and configure Apache,PHP,MySql and phpMyadmin on ubuntu | CONNECTwww.com

  • ZC

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

  • OJ

    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.

    • admin

      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

  • Edric

    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!

  • Cristian

    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!

    • admin

      terminate Skype and TeamViewer and iis or anyother on that port

  • cristian

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

  • Pingback: How to install and configure Apache, PHP, MySql and phpMyadmin on Linux Mint | CONNECTwww.com

  • http://www.jagwindoor.com yassine

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

  • floydro

    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!!!!

  • Abee

    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!!!!!!

  • Shreyas

    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?

  • harsh

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

    • admin

      try to terminate Skype and TeamViewer and iis or anyother on port 80

  • firman

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

  • http://kwinrc.blogspot.com Kelly

    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!

  • Kelly

    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?

  • Piyush

    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.

  • m3trella97

    I’m getting this error message from phpmyadmin.

    The mysqli extension is missing.

    any ideas?

    • admin

      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

  • Ali 24×7

    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!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :)

  • safa

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

    • connectwww

      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