Pragmatism in the real world

Installing PHP on Windows Server 2008

This post is part of a series about my experiences building a PHP app for Windows Server 2008 and IIS 7 for the European WinPHP Challenge 2009 which is sponsored by iBuildings, Microsoft and Leaseweb.

Installing PHP on IIS is easy once you have download the Microsoft Web Platform Installer 2.0. I had a slight hiccup in that all I got was a blank page with a little yellow triangle at the bottom with “Error on page” written next to it. One reboot later and it was happy though.

I then press the “Download” button and got a security alert as apparently my current security settings wouldn’t let me download the file. After adding http://download.microsoft.com/ to the list of Trusted sites in IE’s options, it downloaded. Not the smoothest of experiences and I’m very surprised that downloads.microsoft.com isn’t set up as a trusted site by default. It would have been nice if the security alert message had included a note about what to do to fix it too.

Before running the platform installer’s setup program, I created a snapshot within VMWare Fusion just in case. Once I ran it, I got a nice list and PHP 5.2.9-2 is a simple check and Install away:

WebPlatformInstaller.jpg

I also discovered SQL Server 2008 Express hiding in the Web Platform -> Database tab and URL Rewrite 1.1 inteh Web Server section so I installed those too.

Interestingly, it recommended that I install SQL Server with Mixed Mode Authentication and prompted me for an sa password. After downloading some bits, it needed a reboot and after I had logged in again, it continued downlaoding and installing. Then this happened:

WPI Failure.jpg

One of the really nice things about the PHP community is that even though this is a competition, all the competent competitors are helping me out. I stopped the Web server via the IIS Manager, and the Windows Process Activation Service in the Services tool and tried again. This time it completed.

Now to test it. Being a coward, I rebooted! Why do I have to tell the computer the reason though?!

The web root folder for IIS is c:inetpubwwwroot. I navigated to it using Explorer and then did a right click -> new and discovered that the only choice was Folder. I checked my XP VM and that definitely has Text file as an option for new. I did it the other way using Notepad :)

Navigating to http://localhost/info.php gives me this:

W2K8_PHPinfo.jpg

YAY!

Interestingly, the old mssql extension is enabled, along with mysql and mysqli, but no PDO and no sqlsrv. Very odd. As the PHP installer didn’t include all the dlls in the ext/ folder, I think I’ll be heading for the zip file tomorrow!

Oh, one other Windows Server oddity. When I press “Close” on the windows that opens when I login, it disappears and a “server manager” window opens in its place! I didn’t ask for this window, so why does it appear?!

3 thoughts on “Installing PHP on Windows Server 2008

  1. Drydenmaker,

    Useful! I was just gonna grab the zip version and install the right DLLs myself, but running the installer may be easier.

    Nice to see the the WPI installs the official PHP build without mucking about with it like the Linux distros do.

    Regards,

    Rob…

  2. I'm fairly sure you're making tounge-in-cheek comments about giving a reason for shutting down, but I'll offer:

    The reason for asking this is to maintain an audit trail of power cycles, with an explanation as to why the cycle was initiated. So you have a log of power cycles, much like a log of comments in an SVN repository to accompany commits.

Comments are closed.