FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » How to test if .php is using FastCGI?
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
How to test if .php is using FastCGI? [message #173393] Thu, 07 April 2011 12:16
VanguardLH is currently offline  VanguardLH
Messages: 5
Registered: April 2011
Karma: 0
Junior Member
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:

C:\PHP\php-cgi.exe
or
C:\Windows\system32\inetsrv\fcgiext.dll

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:
http://mydomain/phpinfo.php/foobar?foo=bar
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:
http://mydomain/phpinfo.php
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.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: More with imagettfbbox(); absolute url not working?
Next Topic: Problem getting session through CURL
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 07:54:44 GMT 2024

Total time taken to generate the page: 0.02651 seconds