Installing PHP on Windows Just Got Easier

Web Platform InstallerHave you ever felt frustrated when setting up a PHP/MySQL development environment on Windows? A new all-in-one installer makes the process easier than ever. Perhaps surprisingly, the package comes from Microsoft.

Our latest tutorial, The Easy Way to Install PHP on Windows sees SitePoint’s own Louis Simoneau putting version 2 of Microsoft’s Web Platform Installer (Web PI) through its paces.

Louis will demonstrate how to install PHP with the Web Platform Installer, and along the way will show how conveniently this tool can pull in different open source software packages and install them for you. You’ll learn, for example, how to grab MySQL, WordPress, and Drupal, and watch the Web PI install them all automatically. And therein lies the beauty of the Web PI—you don’t have to dither around configuring stuff yourself.

Louis also gives us a heads up about some of the other cool features, such as the excellent SEO tool, which can analyze your site or application. It’ll check for broken links and provide recommendations to improve the site’s search engine friendliness and overall performance.

The Web PI also has a caching extension for IIS, which improves web server performance and makes it a serious competitor to Apache for hosting PHP applications. Take a look and see what you think.

A huge thank you to Microsoft, who are our sponsors for the multiple choice quiz for this article—if you find the article interesting, be sure to check how closely you paid attention!

Article: The Easy Way to Install PHP on Windows
Quiz: Web Platform Installer Quiz

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

  • Anonymous

    USE XAMPP its the best and the easiest way
    LKH07

  • http://www.50000steps.co.uk sfrost2004

    I still believe the best way is to install each component of the WAMP stack individually – that way you learn more how about how to install and configure each one.

    With an installer, if something goes wrong with one of them, how would you know how to fix it?

  • robbin.joe

    xampp and wamp, twamp are better than ms installer software.

    but if you want to learn, you can install them individually, but in the most cases, use xampp, twamp wamp is best.

  • http://www.mortier.ca/ Ryan Mortier

    I have to agree with sfrost2004, installing each component separately is mu8ch better practice.

  • http://logicearth.wordpress.com logic_earth

    For those above referring to XAMPP or WAMP, missed that those systems use Apache. Not everyone is wanting to use Apache. And there are people out there that want to use Microsoft’s development and server stack. This tool is for them.

    Second, there is no better or easier way. They all do something, each has there pros and cons. However, Microsoft’s solution does have a one pro that the rest should implement. It uses an RSS feed type system which tracks the latest versions. When you download Web Platform you are only downloading a small executable. While others download the whole package. With Web Platform it only downloads and installs what you need and nothing more.

  • lolz

    IIS is poooooooooooor. anyone consciously choosing to use it over apache deserves to be shot

  • Anonymous

    @lolz – Some people don’t have a choice in the matter other than to use IIS.

    That being said, IIS7 isn’t nearly as bad as IIS6 was. Although, I am not going to argue your point that Apache is better because quite frankly it is.

  • http://logicearth.wordpress.com logic_earth

    You should really re-evaluate IIS 7, lolz. I used to be a die-hard Apache user myself. But IIS 7 takes the best of Apache, extensible plug-in-play Modules and makes it the sole means. Everything in IIS 7 is but a module that can be removed, for example, just need a static HTTP server? Or FTP server? Just add only the base module all there is to it. While I would agree to an extent about older versions of IIS the newest version is rock solid. And IMO, IIS is not better then Apache, nor is Apache better then IIS. Each has there own pros and cons and ways of doing things. Taking an unbiased look to picking the right product for the right job is key. Maybe some day people will understand that…doubt it.

    Some good details about IIS 7:
    Bill Staples, My Take: IIS vs. Apache

  • http://www.lunadesign.org awasson

    I use IIS6 (and sometimes apache 2) for developing PHP. I haven’t tried Web PI. I have always installed each component of a WAMP stack one component at a time.

    I agree with sfrost2004, It’s a good idea to at least set up a few IIS WAMP stacks from scratch. You’re forced to learn the platform if you have to download, install and configure each component and that is a good thing. That said, once you an understanding of how to do it under your belt, I see no reason why you shouldn’t use Web PI or any of the other automated packages to speed things up.

    As far as production sites using IIS/PHP goes I’m not a fan. Most of my PHP sites run on LAMP. I have one Drupal 6.xx site running on IIS7 and it is dead slow compared to a duplicate I have running on a LAMP shared hosting account. The IIS7 machine has far less load, better hardware and a nice fat pipe, but it gets walked all over by Linux Apache.

  • Guy Dufour

    does IIS7 support mod_rewrite yet?

    kthxbai

  • flofies

    How much did Microsoft pay you ?
    I can’t believe you took the time to write this article, and I can’t still believe I followed your lead; I did download the whole thing with Moodle and SugarCRM and I could not even get to see the installation (even though I got no error messages).
    I’ve been using XAMPP and although the applications have to be downloaded separately, it’s a child’s game compared to this Microsoft “Bundle”.
    I’m not a Open Source Evangelist nor a Microsoft hater but this experience has turned me into the latter.

  • http://logicearth.wordpress.com logic_earth

    @awasson, how is IIS 7 and PHP setup on the production server? I’ve actually have the reverse effect for my own system. Windows Server 2008 Core, plus PHP 5.3 VC9 build running under FastCGI, is performing exceptionally over the Ubuntu Server on a duplicate machine.

  • http://logicearth.wordpress.com logic_earth

    @Guy Dufour, Yes it does. For IIS 7 there is URL Rewrite directly from Microsoft. For previous versions of IIS there is this URL Rewriter on Codeplex. Both of which are free.

    @flofies, What OS are you using? Windows XP is sadly handicapped with a crap version of IIS 5.1 which only allows a single site. But if you didn’t get an error message that means they installed…but you were not clear on what the problem is.

  • http://www.lunadesign.org awasson

    @logic_earth. My mistake… I just checked and it’s IIS6 on 2003. I’ll have to review my notes to see what the exact setup is.

    On my own machines I’ve loaded up Server 2003 with PHP, JSP, CFM, etc… and have had good success. The site I referred to in my comment is at a web hosting supplier. For most PHP/MySQL sites it is amazingly quick and responsive however it seems to slow right down when dealing with the Drupal Framework. We’re using ISAPI_Rewrite 3 for clean URL.

  • Harry57

    My problem with this is that I find I need to match PHP release versions with the one used by my ISP if I’m to have any expectation that testing locally will mean anything on the production servers. I don’t see that level of version control this has been catered for in the MS bundle – or maybe I’m wrong ????

  • http://www.lunadesign.org awasson

    @Harry57
    It’s been my experience that unless you are working with some specific php functions relating usually with the file system, iis/php and apache/php are interchangeable. I know of a couple of exceptions but they don’t come up often and haven’t ever been deal breakers.

  • Harry57

    It’s more fundamental than that! You may need to revert to older releases eg PHP v 5.1.6 instead of the current v 5.3.0 to retain comparible PHP features to the target ISP. These differences can be huge.

  • http://www.lunadesign.org awasson

    You’ll have to bring up some specifics.

    I’ve been developing PHP since PHP3 about 10 years ago. I’ve used XML/XSLT libraries & extensions in PHP4, CURL, varied methods of accessing the server file system for reading & writing, database access, URL rewriting, pre-PHP5 OOP, post-PHP5 OOP and probably lots of PHP functionality that I’ve forgotten about yet… I have never had a problem moving from one version to another. I regularly develop code using IIS on XPPro and then migrate it to wherever the production server is. Sometimes it’s shared hosting at one of many ISPs, sometimes it’s on a dedicated server.

    Even accessing the files system isn’t a huge leap from Windows/IIS PHP to *nix/Apache isn’t a stretch. The only trouble I can imagine you will find is if you develop PHP5 code and migrate it to a server with PHP4.

  • http://www.lunadesign.org awasson

    I just had a look at the changelog and the difference between 5.1.6 and 5.3 are mostly bug fixes, security patches and additions to make it work better. As far as I can see there is no new functionality added.

  • http://www.50000steps.co.uk sfrost2004

    having read the changelog when PHP 5.3.0 was released, the only major change I noticed was the new date/time functionality and the improved PHP syntax and semantics (like the ?: operator) which may confuse older versions.

  • Harry57

    This is all very interesting.
    I am trying to use a PHP feature to return values from IPTC image metadata, see http://www.jduncan.net/jeanette/asia.php
    On my local XAMPP server this test code works fine:

    but when uploaded it doesn’t. My ISP says that the reason is probably the release level difference and that I need to test locally on the same release as they run to prove that is not the cause, before they will take it seriously. They say the update repositories for the linux distribution they use (Centos) only support version 5.1.6 which follows the security updates from Red Hat linux.
    Now apart from switching my ISP I can only take their guidance.

    Any ideas about what areas to investigate would be very welcome :(

  • http://www.lunadesign.org awasson

    @Harry57
    I’d have to look into that to be sure but my bet is that it is more related to difference in the way PHP on Windows accesses the file system that an incremental release difference. All the same I see where your frustration comes from. I have another machine with a LAMP setup just in case I run into this kind of thing. Can you do the same to see if there is a difference?