IIS5.1: PHP+FastCGI - How to setup and check?



This post is really about how to setup PHP with FastCGI for IIS 5.1 on
Windows XP Pro. If you know of a better newsgroup of where to ask,
please mention in your reply. The microsoft.public.inetserver.iis and
php.general newsgroup look to be full of ads, job listings, and other
garbage and almost no real traffic.

Windows XP Pro SP-3
IIS 5.1
PHP 5.3.6 (installed as "IIS FastCGI" for web server setup)
FastCGI 1.5 (http://www.iis.net/download/FastCGI)

I installed the latest non-threadsafe version of PHP and FastCGI. I did
the edit of the php.ini and fastcgi.ini files. I'm a bit confused
between what different users describe for the setup.

For the Application Mappings (associating the extension to a handler),
some folks have .php use php-cgi.exe (often by running fcgiconfig.js to
add the extension mapping) and others use fcgiext.dll. That is, under
the IIS manager -> right-click on the web site, Properties, Home
Directory -> Configuration -> Mappings tab, the .php extension could be
defined to be handled by:


Maybe what got used changed from the beta to release versions of
FastCGI. I'm pretty sure the second one (using fcgiext.dll) was added
by either the FastCGI install or the PHP install (where I selected "IIS
FastCGI" mode for PHP). As I recall, that's what was there for a
mapping after the PHP install (with web server = IIS FastCGI). I had
figured the .php extension should point at the FastCGI module to use it
and then look in fastcgi.ini to get the definition for the PHP extension
(ExePath, Arguments, etc).

So my first question is which executable should the app mapping specify?
I suspect it's fcgiext.dll despite some articles that say to use
php-cgi.exe. In fact, in fastcgi.ini, php-cgi.exe is the file specified
by the ExePath variable. It seems I have to point the app mapping at
FastCGI which then figures out what to then load from its .ini file.

My second question is how to check if FastCGI is actually handling the
..php files. What I've read, so far, was:

- Create a phpinfo.php file that has:
<?php phpinfo(); ?>
<?php echo '<p>PHP is working</p>'; ?>
- In the output, I look for:
"Server API: CGI/FastCGI" (and not as ISAPI)
This only shows which interfaces that PHP supports. During the
install, I selected "Web server = IIS FastCGI". All you really know
is that ISAPI wasn't used.
- To check PHP is called through FastCGI, one suggestion was noted at
http://tinyurl.com/4xadfss but it has me enter:
This doesn't seem valid as it looks for a path "phpinfo.php/foobar"
rather than load the phpinfo.php file.
o If this URL worked, the authors claim the following vars have the
following values if FastCGI was used:
* Var: _SERVER["REQUEST_URI"], value = /phpinfo.php/foobar?foo=bar
* Var: _ENV["REDIRECT_HANDLER"], value is:
For FastCGI: "php5-fastcgi" (or something with "fastcgi")
For CGI: "application/x-httpd-php"
o Since I get a 404 error when using that URL, I instead just use:
This works but I just get the following value:
_SERVER["REQUEST_URI"] = /phpinfo.php
And there is no _ENV["REDIRECT_HANDLER"] variable defined.

So how do I verify that a .php file is actually loaded using FastCGI.


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question