Click to find out more about our Work
April 19th, 2009

Tutorial : Installing Apache 2.2.11, PHP 5.3, MySQL 5.1.34 & PhpMyAdmin 3.1.4 in Windows Vista/XP

566 Comments

The most recent version of this tutorial has been completely re-written at WebDev Codex.

Learn how to Install PHP 5.3,

To view the latest version, Goto Screencast #1 : Installing Apache 2.2, PHP 5.3, MySQL 5.1 & PHPMyAdmin 3.2 for Windows 7/Vista

If you want to see the screencast of this tutorial, then goto
Screencast #1 : Installing Apache 2.2, PHP 5.3, MySQL 5.1 & PHPMyAdmin 3.2 for Windows 7/Vista

Not everyone would spend money online to buy webspace just so that they can test out how their latest application works, Well… Welcome to Vision Master Designs Blog. This tutorial will teach you to set up a developer environment for PHP/MySQL in your computer in no time.

Index :

If you are aware of the basics then Click Here to jump below, else read on.

Normally we can view HTML pages on our computer without the need of uploading them to the server, since HTML is a Client Side Language. You don`t need any extra software to view html files, just any browser will do the trick.
But if you want to make your pages dynamic using any Server Side Language (PHP,ASP,JSP) & want to the see the results then you must upload the file to the webserver which supports that language so it can execute the file & return the results on your browser

We can set up a developers environment from which you can create and execute PHP/MySQL scripts by installing the above mentioned applications.

Now, The Pre-Requisites :

  1. Apache HTTP Server (2.2.11): The best open source webserver. You need this to turn your humble computer to a powerful webserver to execute your applications.
    Direct Download apache_2.2.11-win32-x86-no_ssl-r2.msi
    Apache Download Page – Please Download the Win32 Binary without crypto (no mod_ssl) (MSI Installer) – apache_2.2.11-win32-x86-no_ssl.msi~ 4.3MB
  2. PHP (5.2.9) : One of the most powerful web programming languages.
    Direct Download PHP 5.2.9 -2 zip package
    PHP Download Page – Download the PHP 5.2.9 – 2 Zip package ~ 10MB
  3. MySQL (5.1.34) : One of the best DBMS packages which is free.
    The latest version is 5.1.34 which is stable and used in production servers. Although MySQL 5.1 and MySQL 6 are also available as beta releases, they are not used in production servers as of now.
    MySQL Download Page – Please download Windows ZIP/Setup.EXE (x86) 5.1.34 ~ 35.2MB
  4. PhpMyAdmin (3.1.4) : Used to manage your MySQL databases directly using your web browser.
    Direct Download phpMyAdmin-3.1.4-all-languages.zip
    PHPMyAdmin Download Page – Please download the latest release from the 3.x rooster.

The above downloads are compatible with Windows Vista/Vista SP1 (32 bit OS).

Pages : 1 2 3 4 5 6

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

566 Responses to “Tutorial : Installing Apache 2.2.11, PHP 5.3, MySQL 5.1.34 & PhpMyAdmin 3.1.4 in Windows Vista/XP”

  1. loz
    April 2, 2009 at 10:42 pm

    its very big

  2. loz
    April 2, 2009 at 1:42 am

    got all but the last bit working when i go to “http://www.myserver.dev/pma/index.php ” after the last myphpadmin configs i restarted the apache server and try to log in but windows brings up a “Apache HTTP Server has encountered a problem and needs to close. We are sorry for the inconvenience.” error, any chance of letting me know were i have gone wrong and what i should do to fix it ?

    many thx :)

    • Michael
      April 2, 2009 at 11:39 am

      @Loz

      Navigate to Apache folder / logs

      paste the message inside error.log perhaps that`ll help me decipher wat the error is.

      Regards

  3. Max
    April 1, 2009 at 12:58 am

    how can i set in mysql password?

  4. Fayz
    March 30, 2009 at 6:37 am

    Update to last post..
    I can login, but just before it loads Apache crashes. So I assume I have definately messed up the httpd file! Could you possibly send me the original or something? I have no track of what I done to that file!

  5. Fayz
    March 30, 2009 at 6:26 am

    Hey, is there a way I can test all this worked correctly?

    I can see the final screens etc, but nothing worked because originally in the index.php file I created at the very start, there was an l in the code (my stupid mistake). So I didn’t know, and I think I messed up httpd in the conf for Apache as I edited a fair bit cause I think I edited the wrong bits!

    Much appreciated tutorial!

  6. Michael
    March 26, 2009 at 8:53 pm

    @Pat

    Pat just change the code in your httpd-vhosts.conf file to the following, it should be fine :)

    <virtualhost *:80>
    DocumentRoot "C:/Server/www/myserver.dev/public_html"
    ServerName myserver.dev
    <directory "C:/Server/www/myserver.dev/public_html">
    Options Indexes FollowSymLinks
    Order allow,deny
    AllowOverride All
    Allow from all
    </directory>
    </virtualhost>
    
  7. Pat
    March 25, 2009 at 10:45 pm

    I got mysql installed and restarted the server. The green light came on and it said service restarted. I tried to access both localhost and http://www.myserver.dev but got an error. “Forbidden you don’t have permission to access / on this server.” Without the quotes of course. Any help will be greatly appreciated. Ive come to far to give up so ile go back to reading more but im not optomistic as ive spent hours reading already trying to fix this problem. Thanx in advance and if I find the answer myself ile post it here.

  8. trungmcst
    March 21, 2009 at 2:37 pm

    i confingure my pc that great
    but when i want create any file .php or htm I tried find where up them but i can’t find where up them
    Help me where create file to wedsite
    I a student wan’ t create site offline
    Thank !

  9. mausser3
    March 21, 2009 at 5:58 am

    i need help at step 4, i cant configure any conf files, but i can see any code to replace in httpd.conf, in search/replace i just see scroll bars.

  10. Tizz
    March 21, 2009 at 5:06 am

    @Tizz

    Just wanted to note that I added http://www.myserver.dev into C:\WINDOWS\system32\drivers\etc\hosts as stated.

    127.0.0.1 localhost
    127.0.0.1 myserver.dev
    127.0.0.1 http://www.myserver.dev

  11. Tizz
    March 21, 2009 at 5:01 am

    I have installed everything EXCEPT mySQL as I am not in need of a database at this point. When I go to http://www.myserver.dev/ I get unresolved host. http://localhost works as expected.

    Do I need mySQL to be installed? Any ideas on what is wrong?

  12. Dennis
    March 20, 2009 at 1:47 pm

    Michael, I posted comment #399. I managed to get the PHP info page but it is without MySQL and MySQLi headings tables as highlighted by Vijay (comment #223). Your response was:-Which extensions did he enabled in the php.ini file. My code is included below for your info:
    [code]
    ;extension=php_bz2.dll
    ;extension=php_curl.dll
    ;extension=php_dba.dll
    ;extension=php_dbase.dll
    ;extension=php_exif.dll
    ;extension=php_fdf.dll
    extension=php_gd2.dll
    ;extension=php_gettext.dll
    ;extension=php_gmp.dll
    ;extension=php_ifx.dll
    ;extension=php_imap.dll
    ;extension=php_interbase.dll
    ;extension=php_ldap.dll
    extension=php_mbstring.dll
    ;extension=php_mcrypt.dll
    ;extension=php_mhash.dll
    ;extension=php_mime_magic.dll
    ;extension=php_ming.dll
    ;extension=php_msql.dll
    ;extension=php_mssql.dll
    extension=php_mysql.dll
    extension=php_mysqli.dll
    ;extension=php_oci8.dll
    ;extension=php_openssl.dll
    ;extension=php_pdo.dll
    ;extension=php_pdo_firebird.dll
    ;extension=php_pdo_mssql.dll
    ;extension=php_pdo_mysql.dll
    ;extension=php_pdo_oci.dll
    ;extension=php_pdo_oci8.dll
    ;extension=php_pdo_odbc.dll
    ;extension=php_pdo_pgsql.dll
    ;extension=php_pdo_sqlite.dll
    ;extension=php_pgsql.dll
    ;extension=php_pspell.dll
    ;extension=php_shmop.dll
    ;extension=php_snmp.dll
    ;extension=php_soap.dll
    ;extension=php_sockets.dll
    ;extension=php_sqlite.dll
    ;extension=php_sybase_ct.dll
    ;extension=php_tidy.dll
    ;extension=php_xmlrpc.dll
    ;extension=php_xsl.dll
    ;extension=php_zip.dll
    [/code]

    Any comment or your valued input to solve the problem will be appreciated?

    Regards Dennis

    Thanks

    Regards

  13. Dennis
    March 19, 2009 at 9:58 am

    After configuring MySQL, I tried to access http://www.myserver.dev , but the page displayed “Index of / index.php txt”. I did not get the PHP page as expected in the installation procedures. I get the same page when I type in “http://localhost/”.
    Both Apache and MySQL have been successfully installed as indicated by . I checked the file index.php is not named as index.php.txt.
    Plse advise if I have not done it right. Many thanks.

    Regards
    Dennis

  14. jessietutu
    March 18, 2009 at 8:51 pm

    @Jason
    i installed the apache server, it can start,but when i try to type localhost in my browser, it show Internet Explorer cannot display the webpage

  15. Jason
    March 18, 2009 at 8:14 pm

    @jessietutu
    What point exactly did you have trouble with?
    Installing the apache server? If you have successfully
    installed the apache server, typing in localhost to the
    browser would display a default page of apache friends
    (most of the times it displays ‘It works!’)

  16. jessietutu
    March 18, 2009 at 7:42 pm

    hi,
    i have a problem. i cant get the apache working. i followed the steps exactly but when i type the localhost in my browser, it just cant display it works. i tried also to type myserver.dev, still not working. before i was installed apache tomcat, and i need to use php now ,so i deleted all that stuffs and uninstalled all the php, apache, mysql, wants to starts all them again, but i cant get the apache works, please help me.
    thanks

  17. Jason
    March 18, 2009 at 12:43 pm

    @shihab
    First, please do not spam your comments. Sure enough someone is notified with your post/problem.. =)

    I have encountered this problem during my first installation. What I did is I uninstalled everything and carefully followed the installation steps here again. After my second install, everything was working perfectly.

  18. shihab
    March 18, 2009 at 11:09 am

    can someone plz help me? I did everything in suggested way, but it doesn’t work with me. after configuring apache, when i try to restart the apache it doesn’t start & show an error message “The request operation has failed”. i tried it too many times. but it happens every time. I’m using apache 2.2.11, php 5.2.9 & win vista.
    can someone plz show me a way to get ride of it???

  19. shihab
    March 18, 2009 at 11:09 am

    can someone plz help me? I did everything in suggested way, but it doesn’t work with me. after configuring apache, when i try to restart the apache it doesn’t start & show an error message “The request operation has failed”. i tried it to many times. but it happens every time. I’m using apache 2.2.11, php 5.2.9 & win vista.
    can someone plz show me a way to get ride of it???

  20. shihab
    March 18, 2009 at 11:08 am

    can someone plz help me? I did everything in suggested way, but it doesn’t work with me. after configuring apache, when i try to restart the apache it doesn’t start & show an errpr message “The request operation has failed”. i tried it to many times. but it happens every time. I’m using apache 2.2.11, php 5.2.9 & win vista.
    can someone plz show me a way to get ride of it???

  21. Gav
    March 16, 2009 at 5:34 am

    First off, thanks for this tutorial.
    This problem is not so much to do with the installing but when I go to configure the MySQL Instance it is a very small window and all i can see is the icon… However I can not resize the window and make it bigger. I can press enter and tab to go through but because I can not actually see what options I am giving it it could be wrong.
    If you have any ideas they would be much appreciated!

    Thanks,
    Gav

    • Michael
      March 16, 2009 at 11:43 pm

      @Gav

      It tends to happen sometimes. the best solution is remove mysql completely and also remove all instances of mysql config.

      try installing mysql again via safe mode

  22. Jason
    March 14, 2009 at 3:45 pm

    @Natasha

    If you typed in myserver.dev during the installation of
    your apache server (as instructed in this tutorial), try
    typing in myserver.dev in your browser url rather than
    localhost. See if “It works!”. :)

  23. Natasha
    March 13, 2009 at 12:16 am

    Hi,
    first of all thank you for the effort.
    However, even though I followed all the instructions carefully, I couldn’t even finish the Step 1 – I didn’t get the page “It works!”
    Do you have any ideas why is that?

    Thanks a lot :-)

    • Michael
      March 16, 2009 at 11:45 pm

      @Natasha

      hey,
      i need to know if u are encountering any error while trying to access myserver.dev or localhost.

      also please check whether index.php is not named as index.php.txt

      also u can verify whether apache has been installed by finding an Apache Moniter Server icon on your taskbar(next to the date in the taskbar)

      Lemme know
      Regards

  24. Jodacs
    March 12, 2009 at 4:47 pm

    Thank you,

    I always hate reinstalling php_mysql, every time
    something new goes wrong. But your guide has saved
    me lots of heart ache.

    Kind Regards
    Jodacs

  25. niraj
    March 9, 2009 at 2:19 am

    hi, i tried following your guide,but after configuring apache 2.2 as told by in step 3 , apache doesn’t restarted properly.

    any ideas?

  26. ANVC
    March 8, 2009 at 7:05 pm

    @Michael

    Hey man!

    Thank you a bunch, but I did not work…

    Actually, I am connecting the Internet via one rooter of the university….In this way, as I do not have a direct access to the internet, the fire-wall of this system is not allowing MySQL to connect to the internet…. Am I right?

    Thanks a lot again!

  27. Jessie
    March 8, 2009 at 1:56 pm

    I got it to work!!! Thank you :)

  28. Ross
    March 8, 2009 at 1:56 am

    Okay, scratch that, Its now starting, but thats not the problem… It seems that its not rendering the PHP, as in, leaving it as text….

    Any ideas for this?

  29. Ross
    March 8, 2009 at 12:18 am

    Hi, I tried following your guide, but when I reached the part where I have to reboot the system, I couldn’t get any further. Apache wouldn’t start, even after I (think I) followed your tutorial pretty much word-for-word.

    Any ideas?

  30. Michael
    March 7, 2009 at 11:04 pm

    @Jessie

    Jessie, I feel PHP hasn`t been installed properly in your system yet.

    Please confirm by checking the Apache Moniter. (in the status bar you`ll notice
    Apache/2.2.11 (Win32) PHP 5.2.9
    if you have php installed properly.

    If it doesn`t show anything, try reinstalling everything again, as per the tutorial. Also do perform a reboot whenever required.

    If you have any query, lemme know :)

    Regards

  31. Michael
    March 7, 2009 at 10:58 pm

    @Rosa

    Hey Rosa
    The line is there, try searching only for

    DirectoryIndex
    

    you`ll find it :)

  32. Michael
    March 7, 2009 at 10:54 pm

    @ANVC
    Hey,

    Try re-installing mysql and please see to it that you are using the latest version. While Uninstalling, do make it a point to remove all settings etc.

    Once after Uninstallation, reboot, then try reinstalling MySQL again. Please do disable the UAC from Control Panel -> Users

    While configuring, do check whether you have given a proper password. (username = root, password = root)

    Lemme know :)

  33. Jessie
    March 7, 2009 at 3:04 am

    Looks like my previous comment was deleted somehow. I don’t see it on the comments… anyway, I had written that I installed Apache, PHP and MySQL using your tutorial. I didn’t really hit any road blocks, until I tried installing MySQL. When I did and tried to open the: http://www.myserver.dev, I my browser prompted me to either “Save” the file or “Find” the right program to open it.

    When I installed PHPMYAdmin, it was the same thing.

    Can you advise?

  34. Rosa
    March 6, 2009 at 7:59 pm

    When I opened httpd.conf for the Apache Program, I couldn’t find DirectoryIndex index.html. What should I do???

  35. Rosa
    March 6, 2009 at 7:41 pm

    I downloaded Apache & PHP, but now my computer runs extremly slow. What can I do about this???

  36. Jessie
    March 6, 2009 at 1:05 pm

    I forgot to type in the code… I get this:

    [code]

    [/code]

    Sorry… it’s late and I’m tired.

  37. Jessie
    March 6, 2009 at 1:03 pm

    Hi Michael,

    First of all, lovely tutorial… It really helped me understand a lot.

    Anyway, I have followed everything to the T. And even read to 70-80% of the comments and I couldn’t find the issue I am having.

    Everything ‘seems’ to work okay, however, every time I try to open the following:

    http://myserver.dev
    http://www.myserver.dev

    I am asked if I want to ‘Save’ the file.

    When I choose a browser to open the file, i get the following:

    And nothing else.

    When I type the following on my browser:

    http://www.myserver.dev/pma/index.php

    It also asks me to ‘Save’ the file. And then it opens as a PHP file.

    Any suggestions?

    I am running Windows Vista, SP2.

    Thanks!

  38. ANVC
    March 5, 2009 at 6:11 pm

    Hey guys! Its me again…

    I opened the port 3306 for the fire-wall, but I am still having problems concerning the last step: Apply Security Settings. It is shown a message like that:

    “The security settings could not be applied to the database because the connection has failed with the folowing error.
    Error Nr. 1045
    Access denied for ‘user’@'localhost(using password:YES) ”

    Do you have any idea what I can do to solve it?

    Thanks a lot!
    Cheers

  39. ANVC
    March 5, 2009 at 5:27 pm

    Hey guys!

    I am facing a problem during the instalation of MySQL… When I press Execute at the final step, a error message is shown: “Cannot create Windows service for MySQL. Error:O”.

    Is this a problem with the port number?

    Thank you very much!

  40. Michael
    March 5, 2009 at 2:05 pm

    @Michael
    Hey,

    After editing php.ini, just reboot the system and then try accessing index.php. MySQL should be loaded.

    Also do check whether you have specified the extensions directory in php.ini

    Regards

  41. Morris
    March 4, 2009 at 1:06 pm

    perfect, thank you so much!

  42. Nakul Sharma
    March 3, 2009 at 3:32 am

    All the steps defined are quite easy to follow…
    Did the same as instructed…PHP is up and running!!!!

  43. Michael
    March 3, 2009 at 12:46 am

    Hi guys,

    This tutorial is great. I have got as far as phpmyadmin but i’m stumped on what to do.

    I tried to log in with the attributes root and root.

    It returned as follows:

    ‘Cannot load mysql extension. Please check your PHP configuration. – Documentation’

    Anyone got any ideas? So close yet so far away…

    Thanks,

  44. RonT
    March 2, 2009 at 3:00 am

    @RonT

    Okay, I seem to have everything working. I pressed ahead and installed the phpadmin but got the same error 1045. I followed the instructions in the link http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html to reset my root password for MySQL and everthing now appears to work.

    Excellent tutorial. In php.ini I also removed the “;” to activate the line :
    extension=php_mcrypt.dll

    This got rid of the warning at the bottom of the last screen in the tutorial. Hopefully, this is okay?

  45. RonT
    February 28, 2009 at 6:49 am

    Help! I get Error 1045 on the final “apply security settings” step when running the MySQL server instance configuration wizard.

    Access denied for user ‘root@localhost’(using password:YES)

    I’ve totally disabled my Windows Firewall. When I tried to open port 3306 for MySQL the System said that it already was open. I have Norton running but not sure how to turn off its firewall. Also not clear whether once the WAMP installation is successfully completed whether the firewalls need to be turned on again?

    Is the Norton Firewall the problem? I’ve restarted my computer many times and gone so far as to uninstall MySQL as well.

    I’m stumped.

  46. Michael
    February 27, 2009 at 10:57 pm

    @keeth

    @Eduardo

    The error “Your PHP MySQL library version 5.0.51a differs from your MySQL server version 5.1.31. This may cause unpredictable behavior.” won`t cause any problems, I have been using PHPMyAdmin and till now I haven`t experienced any problems with this warning sign.

    So no need to bother.
    Regards

  47. sy
    February 27, 2009 at 6:03 am

    thanks, it works now :D
    btw i have three hosts files in my windows.
    two of them are backup files and one is in .bak format

    which one is am i suppose to edit?

  48. Eduardo
    February 26, 2009 at 6:43 pm

    I Installed, for Windows Vista:
    MySQL: 5.1.31 (but in my phpinfo said: Client API version 5.0.51a)
    Apache: 2.2.11
    PHP: 5.2.8

  49. keeth
    February 26, 2009 at 1:49 pm

    Keeth :
    @Michael
    I’m having the EXACT (exactly exact) same problem as Ed (except I installed each program by itself).
    Apache: 2.2.11
    MySQL: 5.1.31
    PHP: 5.2.8
    phpMyAdmin: 3.1.2
    This is all on Windows XP, by the way.

    I probably should have posted this instead of saying “I’m having the exact same problem as Ed.”

    Here’s the error I get when I log into phpMyAdmin: Your PHP MySQL library version 5.0.51a differs from your MySQL server version 5.1.31. This may cause unpredictable behavior.

  50. Keeth
    February 26, 2009 at 1:48 pm

    @Michael
    I’m having the EXACT (exactly exact) same problem as Ed (except I installed each program by itself).

    Apache: 2.2.11
    MySQL: 5.1.31
    PHP: 5.2.8
    phpMyAdmin: 3.1.2

    This is all on Windows XP, by the way.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code lang=""> <del datetime=""> <em> <i> <p> <q cite=""> <strike> <strong>