Explore Videos MSDN eNews Connect
Startup
Windows
Web
Phone
Cloud
Visual Studio
Security
ALM
Breakpoint
Canada Does Windows Azure
More
The latest on developer tools and technologies you care about.

Sign Up
Latest Edition
Previous Editions  
Stay connected online and offline.

Twitter
Facebook
LinkedIn
User Groups

Installing PHP on Windows Using the Web Platform Installer 2.0 Beta

Installing PHP on Windows Using the Web Platform Installer 2.0 Beta

  • Comments 5

Yesterday, I showed you how to install MySQL Server 5.1 (Community Edition) onto your Windows-based development machine. The reason I wrote the article was to help you prep your machine for installing PHP and PHP-based applications using Microsoft’s Web Platform Installer.

What is Web Platform Installer?

Web Platform Installer is, as the website puts it, “a free tool that makes it simple to download, install and keep up-to-date with the latest components of the Microsoft Web Platform”. Yes, this is stuff you can do yourself, but I’m all for tools that automate away drudgery.

As of this writing, there are two versions of Web Platform Installer available: the original 1.0 version and the beta 2.0 version. In this article, I’m going to focus on the 2.0 version.

Here’s what you’ll see when you fire up the Web Platform Installer 2.0 beta:

wpi_01

Web Platform Installer has three tabs:

  1. What’s New?: This lists the newest applications that are available for download and aren’t already installed on your system. This is the tab that is automatically selected when you launch Web Platform Installer.
  2. Web Platform: This lists web platform applications that are available for download and whether they’re installed on your system. These apps are divided into the following categories:
    • Web Server Applications: Extensions for IIS as well as other server software such as the FTP server
    • Frameworks and Runtimes: Both Microsoft and open source frameworks and runtimes, such as .NET Framework and ASP.NET MVC. This is where you’ll find PHP.
    • Database: SQL Server Express and management tools.
    • Tools: Applications for web development, such as Silverlight and Visual Web Developer Express.
  3. Web Applications: This lists web applications that are available for download and whether they’re installed on your system. These apps are divided into the following categories:
    • Blogs: A selection of .NET blogging apps such as BlogEngine.NET and DasBlog, as well as WordPress.
    • Content Management: Applications like DotNetNuke and Acquia Drupal.
    • Galleries: Photo gallery applications.
    • Wiki: Wikis and apps with wiki functionality, such as the PHP-based Acquia Drupal and the ASP.NET-based ScrewTurn Wiki.

Installing PHP

If PHP isn’t on your system, it will appear on the What’s New? tab page. If you click on the “information” icon beside the checkbox item for PHP, you’ll be shown its information page:

wpi_02

You can choose to install PHP by checking PHP’s checkbox in the list of applications or the Click to include in your install button.

You can choose to add other applications to your install. Once you’ve chosen all the apps you want, click the Install button. You’ll be presented with a list of the apps you chose for review, along with any dependencies for those apps:

wpi_04

To start the installation, click the I Accept button, and Web Platform Installer will do its thing:

wpi_05

Taking PHP for a Quick Spin

Let’s write a very quick script to confirm that PHP is up and running:

<?php

phpinfo();

?>

In case you’re not familiar with PHP’s built-in phpinfo() function, it returns information about your PHP installation, its configuration and its current environment. It’s useful for all sorts of things, not the least of which is checking to see if your PHP installation worked.

Enter the script above using your favourite editor, and save it as test.php into the web root directory, c:/inetpub/wwwroot Note that in order to save to this directory, you’ll need to be running the editor with administrator privileges. Alternately, you can save to another directory and then copy the file to c:/inetpub/wwwroot, giving your administrative approval when prompted by the dialog box.

Then point your browser at http://localhost/test.php -- you should see something that looks like this:

wpi_06

Next Steps

With PHP up and running, you can install PHP-based apps. PHP apps are like old-school ASP apps; installing them is often a matter of moving the files into the webroot directory and perhaps running an install script by typing its URL into your browser.

phpMyAdmin

One app you might want to consider installing is phpMyAdmin, a PHP-based web application for administering MySQL databases. While it’s possible to administer MySQL solely through its command-line interfaces, phpMyAdmin makes it so much easier. I can’t recommend this utility enough.

Cover of "Wicked Cool PHP"

If I had to recommend just one PHP book, it would be No Starch Press’ Wicked Cool PHP. I find No Starch books to be both informative and enjoyable reads, and this book is no exception. If you’ve got at least a little programming experience under your belt. I think that you’ll find this book and its very useful examples, coupled with the online documentation at PHP.net, will serve you very well.

Happy PHPing!

Leave a Comment
  • Please add 4 and 2 and type the answer here:
  • Post
  • PingBack from http://www.globalnerdy.com/2009/05/05/installing-php-on-windows-using-the-web-platform-installer-20-beta/

  • helpful and easy to understand.

  • This week, I’m going to have my hands full on Friday with WordCamp Toronto , so I’m moving my Coffee

  • It's really nice and helpful, however, you still have to do Application Mapping on IIS manually:

    .php "C:\Program Files\PHP\php-cgi.exe"

  • I have PHP Version 5.2.1 installed on my Win XP Pro box. I have MySQL Server 5 installed. I have a session variables working fine. I have a couple of PHP web apps running on the box just fine.

    But I cannot instal phpMyAdmin. There seems to be no straightforward instal; you have to tweak so many stupid values by hand; and the end result for me, when I try to view the app at http://localhost/phpmyadmin, is the following output:-

    ==

    phpMyAdmin - Error

    Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.

    ==

    I can find nothing of any use in any logs. It's a dead end for someone like me who is not an expert at how phpMyAdmin is trying to work. There is no clue pointing me where to look for the answer. It would be great if phpMyAdmin could be added to the Web Apps Gallery, because a hand-instal is brutal.

Page 1 of 1 (5 items)