15 September 2006

PHP, MySQL and IIS 6 - what have they done?

Talk about making life difficult. It's been a while since I've had to set up a WIMP (Win/Mysql/PHP) and this is the first time I've put it together on Win server 2003 using IIS6. All I can say is sysadmins are REALLY undervalued.

To start with, Win server 2003 is configured by default to serve static web-pages (pure HTML, no ASP/PHP/CGI dynamic content). This was a pain as the current PHP installer does not reconfigure IIS automatically (yes there is an option to install on an IIS 6 machine however on server 2003 you will find it still doesn't want to serve anything but static pages after the install). Luckily I found a good article at iis-resources.com to fix this.

So next I installed PHP 5.04 which seemed to go on ok (little did I know what was coming). After PHP, I started looking into Xoops - a free CMS based on PHP and MySQL. Well I've not used it before and it sounds like it might be useful for the project I'm working on so I decide to give it a try. The FAQ says it requires MySQL 3.23 so that got installed next (and it took much longer than it did to type it since MySQL is now up to version 5 and you have to root around their site for the older versions).

So everything appears to be going well. I fire up Xoops and begin the configuration and get so far before I reach an error about the MySQL module not being loaded. This is because PHP 5 no longer installs with MySQL supported. Now I DO remember being asked which web-server I was using at install even though it didn't auto install. Would it really be difficult to add a simple question on that installer - would you like MySQL (or drop-down list) database support?

It prooved to be quite a hassle as the php.ini file has to be modified. The extensions_dir setting has to be set to C:\PHP\ext (like that couldn't have been the default setting?). Then you have to remove a single semi-colon in front of the line which reads extension=php_mysql.dll. It still didn't work. Eventually I came across an article about adding c:\php to the path environment variable. To avoid any further delays I just copied the libmysql.dll to windows\system32 directory. Yes I know they advise you not to do that to avoid forgetting about repeating that step when you upgrade to a newer version but this is for a test system on a closed LAN and at this stage I just want to find out if Xoops is worth using.

Now I know these aren't difficult jobs for an experienced admin but COME ON developers. I've set up Wimps before using Xp Pro/PHP5 and various versions of MySQL and they were all much quicker to set up than this. Whoever at Microsoft thinks someone is going to buy Win server 2003 to serve static pages needs a good slap with a reality stick. If it wasn't for the fact that the 2k3 boxes are needed for training people how to use 2k3 I would have used slackware instead and had the server up and running in half the time. Adding the isapi by hand... better use the BIG reality stick.

As for PHP, well if you want people to use it's nice new XML features it might be a good idea to sort out a new installer. I can imagine so many people reverting to a previous version just to avoid these set-up issues.