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 🙂
Best Answer
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):
Extract the contents of the zip file to a folder called
C:\PHP
so that in this folder you have the following subfolder structure:Rename one of the
php-*.ini
files tophp.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:
Once installed, edit
C:\Windows\System32\InetSrv\fcgiext.ini
so that it contains only the following: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 clickConfiguration
: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:
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: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: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 generatedIUSR_<MACHINE_NAME>
anonymous account then you shouldn't need to change anything.