I decided to install Drupal on my Vista x64 Machine, and what an adventure it was.
Installing a LAMP (Linux, Apache, MySql, PHP) Server is something I’ve done in the past, and I never had problems with it, I also installed PHP on Windows before, back in the “old” XP days.
I was curious to see how PHP was going to work with IIS 7, this was also an opportunity to explore some new feature available with IIS 7 namely the FastCGI support, Microsoft URL Rewrite Module for IIS 7.0 and the new administration console.
First things first, to install Drupal it’s required PHP and MySql. Installing MySql on Vista is easy enough, you just need to download the MSI file from MySql Site, run the setup and finally run the configuration utility (the setup does it automatically).
I’m using MySql with Vista an with Ubuntu as well, it works well on both systems. A lot of people are using myphpadmin to administer MySql Server, I personally prefer MySql Administrator. I prefer it because it’s fast and it’s not web based, the downturn it that I cannot administer the server remotely, but I don’t need that, so it works fine for me this was, you can dowloaded it from here.
That was the easy part. Install PHP was easy as well. But install FastCGI and configure PHP to use it was not so simple.
iis.net has a lot of very useful resources about IIS, PHP and FastCGI, unfortunately I discovered some of those only after this process.
Here are the ones I find most useful for this task:
Drupal on IIS
Partying with PHP on IIS 7
Using FastCGI to Host PHP Applications on IIS 7.0
I’ll not describe in detail what is required for each step, because all that information can be viewed using these links.
As I said unfortunately I discovered the first one after the installation. I read all of them and it was quite easy to find things and setup everything but as always there’s something that goes wrong.
The steps are the following:
- Update IIS 7.0 FastCGI module
- Enable FastCGI support in IIS
- Install PHP (Here I prefer to run the MSI file but it’s also possible to unzip PHP to a folder and manually do the configurations, for me the main advantage of the MSI is that it should setup IIS for you, but that was not my case, also the installer will enabled all the extensions and that was one of my problems.)
- Configure IIS to handle PHP Requests (This shouldn’t be necessary because the installer is designed to do this, I don’t know why but in my case this doesn’t worked, so I need to do the configuration.)
- Install Drupal
If you read all the above tutorials you should be fine.
The first thing I read was “Using FastCGI to Host PHP Applications on IIS 7.0″”, but I made some mistakes.
First I installed PHP with CGI support and not FastCGI, it all seems to work great, and I could see the famous phpinfo() returning the standard information, but as soon I try to install Drupal I got a lot of errors.
It seemed that PHP was unable to find all the extensions, I checked php.ini and the extension folder was pointing to the correct location.
I checked the permissions for ISURS and Network Service and they where correct, so instead of trying to fix this I wanted to enabled FastCGI. And so I did, I deleted the Handler Mapping on IIS and created the correct mapping using FastCGI, then I tried phpinfo to see if everything was ok and immediately IIS crashed. Locking further what I discovered was that some extension that came with PHP was causing errors, what I did was to disable all the extensions, as soon I did it phpinfo() was again OK, so I went to Drupal setup and enabled only the extensions required for the setup, that are basically mysql and mbstring to enable Unicode support.
Another thing that happened during setup was that the process was unable to configure the database connection, so I needed to manually edit the file and change it. This is quite a simple process just edit “setting.php” file from “/sites/default”, locate the “$db_url” and changed the values.
I still didn’t understand completely what was wrong when activating FastCGI support for the first time, but probably the best thing to do is to disable all the extension before enabling FastCGI. That way it’s easier to isolate the problems.
There’s also the security questions, that last time I setup PHP on Windows was with Windows XP, Vista is far more sensible to permission issues that XP, so it’s best to understand which users and folders you need to give access to before installing.
Again this is an easier process with Linux, but all in all it was an interesting challenge to do it on Vista, I’m glad that in the end all worked well.