Error When Installing PHP5 on IIS6

I am trying to install PHP on my Windows Server 2003 machine that is using IIS6. I followed this guide for installing it, including using the binaries of fastCGI. I think I did everything correctly, however, when I went to create my phpinfo(); page I get the following: Server Error, unable to connect to fastcgi server.

I've tried looking in all the logs I can think of. Nothing in IIS log that is helpful, PHP never even logged an error or anything and nothing in my events log.

-

That's a pretty out of date blog entry and life has moved on substantially since then. So forget everything you read on that page :)

Download the latest stable version of PHP for windows. In this case download the PHP 5.3.6 x86 Non Thread Safe zip file (note: the version number may change as the PHP team release new stable binaries):

Extract the contents of the zip file to a folder called C:\PHP so that in this folder you have the following subfolder structure:

C:\PHP\dev , C:\PHP\ext , C:\PHP\extras, etc


Rename one of the php-*.ini files to php.ini and edit according to any requirements you may have.

2. Install/Configure Microsoft's FastCGI Extension for IIS5.1/6.0:

Once installed, edit C:\Windows\System32\InetSrv\fcgiext.ini so that it contains only the following:

[Types]
php=PHP

[PHP]
ExePath=C:\PHP\php-cgi.exe


3. Configure IIS PHP Scriptmap:

Edit or add the .php scriptmap to your chosen website (or you can add globally) by right clicking on the site and choosing properties:

Choose the Home Directory tab and click Configuration:

Click Add (or if you still have the .php scriptmap listed, then remove it and re-add).

You need to populate the Executable and Extension fields with these values:

Executable: C:\WINDOWS\system32\inetsrv\fcgiext.dll
Extension: .php


Click OK and save these changes.

4. Configure PHP FastCGI Settings in PHP.INI:

Open C:\PHP\php.ini in an editor and locate and configure these settings:

fastcgi.impersonate = 1
cgi.fix_pathinfo = 1
cgi.force_redirect = 0
date.timezone = Europe/London  ; (http://uk3.php.net/manual/en/timezones.php)


It seems you need to set the timezone now for the phpinfo(); page to render properly, but it's a good idea to set this anyway.

5. Test PHP:

Create a file called test.php with the following:

<?php
phpinfo();
?>


Browse to this page and if all is good you should see:

After that it's all up to you to fine tune your configuration such as deciding which extensions to use and so on.

After Thoughts:

Depending on how your system is set up you may need to adjust the permissions on the C:\PHP folder. If it's a pretty stock installation and your sites are running in application pools using the Network Service account and you're using the generated IUSR_<MACHINE_NAME> anonymous account then you shouldn't need to change anything.

-
I forgot to update this :P I ended up switching to fastCGI from iis.net and it solved the problem, you have a very good guide there though, thanks a lot. e: uff, I don't have 15 rep yet on this site so I can't "up" your answer yet, will "up" it later once I get the rep. – numone Mar 29 '11 at 2:53
@numone - I just gave you a bump to 20 for the question :) – Kev Mar 29 '11 at 8:35