Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

Help Please and Thanks :)

share|improve this question
add comment

2 Answers

up vote 11 down vote accepted

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 :)

1. Download PHP:

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):

http://windows.php.net/download/
http://windows.php.net/downloads/releases/php-5.3.6-nts-Win32-VC9-x86.zip

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:

Install Microsoft's IIS6 FastCGI extension which can be downloaded from here:

http://www.iis.net/download/fastcgi

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:

enter image description here

Choose the Home Directory tab and click Configuration:

enter image description here

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:

enter image description here

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.

share|improve this answer
    
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
add comment

You may find errors in the php log in C:\WINDOWS\temp\php-errors.log

They only appear in the event log if you modify your php.ini file (in c:\windows if you've followed those instructions) and take out the semicolon on the line

;error_log=syslog

share|improve this answer
    
Actually looks like he's using a horribly out of date installation guid dating back to the ark. –  Kev Mar 26 '11 at 13:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.