IIS6.0, FastCGI Go Live, Windows Server 2003

With all the hoopla about FastCGI on IIS I thought I'd give it a whirl. Here's what I did.

Installed Windows Server 2003 R2 Standard Edition.

Selected Application Server role. This installs IIS 6.

Setup autologin since this is a disposable virtual machine.

Fought IE7's draconian security popups to download Firefox.

Downloaded mysql-essential-5.0.45-win32.msi.

Downloaded php-5.2.4-nts-Win32.zip. (This non-thread-safe version is recommended to use FastCGI).

Extracted the contents to C:\php.

Went to My Computer - Properties - Advanced - Environmental Variables and added ,C:\php to the PATH variable.

Renamed php.ini-dist to php.ini. I used php.ini-dist since this is just a development box.

In php.ini:

- uncommented fastcgi.impersonate = 1 since I plan to run it with IIS.
- set doc_root = "C:\Inetpub"
- set session.save_path = "C:\php\sessiondata"

Opened port 80 in the firewall. I can now send a request to IIS and get back a response in my web browser. The response is an Under Construction page since I haven't set a default page in IIS yet. Made a index.htm file and said Hello World.

Downloaded FastCGI Extension for IIS6.0.

The End-User License Agreement includes this: "You may not disclose the results of any benchmark tests of the software to any third party without Microsoft's prior written approval". Thus you will not see any benchmarks from me.

And this: "If you give feedback about the software to Microsoft, you give to Microsoft, without charge, the right to use, share and commercialize your feedback in any way and for any purpose." Thus you will not see any feedback about the Microsoft FastCGI Extension for IIS 5.1 and 6.0 Go Live software from me.

Configured FastCGI according to these instructions.

My C:\WINDOWS\system32\inetsrv\fcgiext.ini file contains the minimum:

[Types]
php=PHP

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

I created a basic hello.php file containing

<?php
echo "Hello world from PHP.";
?>

.

I can now do \php\php.exe \Inetpub\wwwroot\hello.php at the command line and it works.

But hitting it through IIS results in

FastCGI Error

The FastCGI Handler was unable to process the request.


Error Details:

  • The FastCGI process exited unexpectedly
  • Error Number: -2147467259 (0x80004005).
  • Error Description: Unspecified error

HTTP Error 500 - Server Error.
Internet Information Services (IIS)

Using Rick James' Fake FastCGI Web Server to say

C:>fakefcgi.exe c:\Inetpub\wwwroot\hello.php c:\php\php-cgi.exe

I get

Fake FastCGI web server
FCGI_PARAMS sent
FCGI_STDIN sent
Launching receive loop
FCGI_STDOUT: Status: 404
X-Powered-By: PHP/5.2.4
Content-type: text/html

No input file specified.

FCGI_END_REQUEST received
killing app
FastCGI process exited with 0

I installed procmon and discovered that the IIS user (NETWORK SERVICE) did not have Execute access to C:\php\php5.dll. Once that was granted, my hello.php ran.

The next problem was that I wanted to set up Drupal, so clearly I need to run MySQL. But PHP would not load the C:\php\ext\php_mysqli.dll file. Again, a permissions issue solved by giving NETWORK SERVICE access. Clearly I must have missed the permissions section of the PHP installation docs.

Thanks to Drew Robbins of Microsoft for debugging the extension permissions issues.

Comments

<>

Understated, self deprecating, but accurate. Thanks for making your research available it saved me today.

Thanks for this post, John.

I've been trying to get FastCGI to work with IIS 6 for two days now.

I also got the HTTP 500 error, but now I no that the IIS user has not enough rights to execute the DLL's

Cheers!

Hi I have the same problem.

FastCGI Error
The FastCGI Handler was unable to process the request.
--------------------------------------------------------------------------------

Error Details:

An error occurred processing config file.
Error Number: 5 (0x80070005).
Error Description: Access is denied.
HTTP Error 500 - Server Error.
Internet Information Services (IIS)

I am using PHP 5.2.6 and I didn't see php5.dll

Please help me to figure out.

Thanks

I ran procmon and noticed that php-cgi was looking for the fastcgi ini file in a different location, namely c:\php5\php-cgi-facgi.ini

I copied the ini file here and renamed it and then php pages started to work fine.

same problem:

i want my programme running all the time. so i set my fcgiext.ini like this,but it does not work..

ExePath=D:\PHP\php-cgi.exe
InstanceMaxRequests=0
EnvironmentVars=PHP_FCGI_MAX_REQUESTS:0
RequestTimeout=0
ActivityTimeout=0

FastCGI Error
The FastCGI Handler was unable to process the request.
--------------------------------------------------------------------------------

Error Details:

An error occurred processing config file.
Error Number: 5 (0x80070005).
Error Description: Access is denied.
HTTP Error 500 - Server Error.
Internet Information Services (IIS)

I'm using IIS 6 and was getting:

The FastCGI process exited unexpectedly
Error Number: -2147467259 (0x80004005).
Error Description: Unspecified error

but fixed it by installing the "VC9 x86 Non Thread Safe (2009-Jun-30 08:52:54)" version of 5.3 available here:

http://windows.php.net/download/

Hi
i have total 20,000 records in data base so when i want to display the total records i get the following error
can any one help for that.
please

FastCGI Error
The FastCGI Handler was unable to process the request.

Error Details:

* The FastCGI process exceeded configured activity timeout
* Error Number: 258 (0x80070102).
* Error Description: The wait operation timed out.

HTTP Error 500 - Server Error.
Internet Information Services (IIS)

I read about 20 versions of how to install FastCGI on 2003.
And it seems to be simple...

Set ACL's to use NETWORK SERVICE on these folder/files

C:\php\php-cgi.exe
C:\php\php5.dll
C:\php\ext

Now it works and starts all my active extensions without errors.

Before I installed php-5.3.4-nts-Win32-VC9-x86.zip,But always Tips Error Number: 14001 (0x800736b1) so I download PHP Installer:php-5.3.4-nts-Win32-VC9-x86.msi with http://windows.php.net/download/ but still tips me Error Number: -2147467259 (0x80004005).
and I edit C:\WINDOWS\system32\inetsrv\fcgiext.ini file contains the minimum:
[Types]
php=PHP
[PHP]
ExePath=C:\php\php-cgi.exe <----thsi is your install Directory
All the problems solved, finally i can see phpinfo

Sorry, English is not my native language, reading is not convenient for everyone to bring Please forgive me