Turbo-charge your PHP applications with IIS FastCGI Technical Preview 2

After 3 months of community feedback and development, the FastCGI Techical Preview 2 has just been released! 

Before I jump into the juicy details, I want to thank everyone who has tried out the original release, and given us bug and feature feedback on the FastCGI forums.  This has been incredibly valuable in driving the feature forward, and I look forward to more of it as we move towards FastCGI beta (more on this later in the post).

– 2/10/2007: The Windows-optimized PHP 5.2.1 is now available from www.php.net/downloads.  Learn more about it here.
– 2/18/2007: Instructions on how to run Ruby on Rails with IIS FastCGI TP2 have been published.

First things first

The FastCGI Technical Preview 2 release is an update for the first ever release of Microsoft IIS FastCGI feature in October 2006, providing a platform for high-performance and reliable way to run application frameworks like PHP on IIS (see my other posts about FastCGI and PHP). 

It is now available from the FastCGI main page on www.iis.net, with the following packages:

  1. FastCGI for IIS 5.x / IIS 6.0 – for Windows XP, and Windows Server 2003
  2. FastCGI for IIS 7 – for Windows Vista (RC1+), and Windows Server codenamed "Longhorn"

This release supports both 32-bit and 64-bit operating systems, so be sure to download the appropriate flavor of the package for your operating system.  The 64-bit package will work "out of the box" in both native 64-bit and 32-bit WOW64 IIS application pools on your 64-bit Windows OS, so you dont need to worry about any additional configuration.

FastCGI Tech Preview 2 is fully compatible with PHP 5.2, currently available from www.php.net/downloads.  You can install the FastCGI package and configure it to work with PHP by following the updated instructions in the updated Using IIS FastCGI with PHP article.  It should also work with PHP 4, although we havent extensively tested it, so if you run into any issues, please report them on the Forums.  

So, what am I getting?

The original technical preview release from October 30th of last year provided basic FastCGI functionality for running PHP applications.  Technical Preview 2 contains the following bug fixes and enhancements:

  1. Native support for 64 bit Windows operating systems.  The 64-bit packages provide full installation support for 64-bit OS, and enable both native 64-bit and 32-bit WOW64-based IIS applications.  The FastCGI application, such as PHP, can be either 32 bit or 64 bit.
  2. Additional server variables used by PHP and other FastCGI frameworks.  These include DOCUMENT_ROOT, REQUEST_URI, and SCRIPT_FILENAME.
  3. Support for PHP's fcgi.impersonate.  This enables PHP applications on Windows to impersonate the authenticated user making the request, enabling the PHP scripts to execute as that user instead of the identity of the IIS worker process.
  4. Improved error handling.  Added a number of error messages for common error conditions such as miconfiguration.  This is primarily done in the IIS7 package version.  Also, provided proper handling for FastCGI application errors, such as PHP script errors. 
  5. Improved FastCGI application process management.  The FastCGI component is now resilient to shutting down or killing the IIS worker process, or stopping the IIS service, making sure to terminate the child FastCGI application processes.  This means that you should no longer see orphaned php-cgi.exe processes when you do any of the things above.
  6. Improved timeouts.  Several changes to make the timeouts more flexible / correct, including the added the activityTimeout setting, which insures that the child FastCGI process remains responsive.  Also added the idleTimeout setting, which controls how long the process can be idle before its terminated,
  7. Enabled the TCP transport mechanism.  This provides support for TCP-based FastCGI application implementations.
  8. Removed the response entity-body, and request POST entity-body size limitations.  Previously, internal constraints limited this to 1 Mb each.
  9. Support for passing command line arguments to FastCGI application processes.  Allows FastCGI applications that require command line arguments to be specified to be used with the FastCGI feature.
  10. Experimental Ruby support.  More on this including setup instructions in the next post!

Look to the next post for more details on the configuration options, and advanced functionality, including how to set up Ruby with FastCGI on IIS.


In order to use the FastCGI package, do the following:

  1. Download the appropriate FastCGI TP2 package for your IIS version (IIS6 vs. IIS7) and OS bitness (32-bit vs. 64-bit)
  2. Unzip it to a local directory on your machine
  3. Use fcgisetup.js (IIS6) or fcgisetup.exe (IIS7) to install it:

    IIS6: cscript fcgisetup.js /install
    IIS7: fcgisetup.exe /install

    Note that the TP2 installation automatically replaces the TP1 installation if present.  It also does not require TP1 to be installed.

  4. Then, configure FastCGI TP2 with your scripting environment, like PHP, for example:

    IIS6: cscript fcgisetup.js /r /add c:phpphp-cgi.exe php  
    IIS7: fcgisetup.exe /add c:phpphp-cgi.exe php

This is the short of it.  Please read the detailed how-to in the Use PHP with FastCGI article.  If you need last minute reference, the instructions are also available in the included "readme.txt" file, and from the fcgisetup installer as command line help.

What's next? The FastCGI roadmap

The Technical Preview 2 release is still in the tech preview stage, and as such is not meant for production environments.  It is an opportunity for us to get the fixes out to the community for evaluation, and gather more feedback as we move forward to a well-tested, stable beta release suitable for production environments.

We are hoping to be ready for the Beta release for both IIS6 and IIS7 platforms sometime around April.  This is currently tentative, and since our first priority right now is getting IIS7 ready for primetime in Longhorn Server, plans may change.  Keep watching the FastCGI forums and this blog for more news as time goes on.

Another incredibly exciting event is the anticipated arrival of PHP 5.2.1 (you ca
n get the dev builds right now from www.php.net), which will contain the majority of Zend's core PHP fixes designed to significantly improve its performance on Windows.  Combined with the IIS FastCGI feature, this should provide unparallelled PHP performance on the Windows / IIS platform.  As soon as this is available, be sure to grab it – I will also post some performance numbers to show it off.

Now, go download the FastCGI Tech Preview and let me know how it goes.  You can get support, and report issues on the IIS6 FastCGI forums and the IIS7 FastCGI forums.  Watch my blog for more details over the next week …

We are all looking forward to your feedback!


  1. Anonymous

    This is great! Have two questions though that I can’t seem to find answers for anywhere;

    1) All the talk with this FastCGI module has been about PHP on IIS. The “experimental ruby support” line has me wondering, will there be any support for any other frameworks such as Python or Perl?

    2) Any idea under which license this FastCGI module will be released once it is production ready?

  2. Mike Volodarsky

    The FastCGI project has a strong PHP focus, as part of our effort together with Zend to make PHP rock on Windows / IIS.  

    But, that said, the FastCGI feature is a platform feature for running FastCGI compliant applications, so our goal is to make sure it supports the popular frameworks like Python, Perl, Ruby, etc by RTM.  There are a few issues we have found with each of these frameworks that currently impact our ability to run them, but hopefully we will get there.

    Specifically for Ruby, Tech Preview 2 contains the "experimental support" necessary to get basic Ruby functionality.  I will be posting instructions shortly on how to set it up.  We are looking forward to community feedback, just like we got for PHP for the initial FastCGI release, to help us get more solid support for Ruby for beta.

  3. Mike Volodarsky

    The downloads have been updated with the fix. Please let me know if you encounter other issues while using the new package.

  4. Anonymous

    Is it just me, or am i missing something?

    The documentation is missing, at least install instructions are.

    Do i need TP1 before i can upgrade TP2?

    TP2's fgiconfig program (running it with /h switch) refers to fcgisetup which is not available within the

    FastCGI Technical Preview 2 download.

  5. Mike Volodarsky


    You dont need TP1 in order to install TP2, and TP2 will install over TP1 without a problem. Here is where you can find instructions on how to install:

    1) Inside readme.txt included with the package
    2) In the detailed how-to article for setting up PHP with FastCGI TP2, also linked above – http://www.iis.net/default.aspx?tabid=2&subtabid=25&i=1345

    I also added the instructions to the blog post for additional discoverability.

    Thanks, Mike

  6. Mike Volodarsky

    Thanks for the heads up. We have been having some trouble with the website … what you are seeing in the amd64 package is what would be expected for the x86 as well, with the exception of the amd64 subfolder. Let me look into it …

  7. Mike Volodarsky

    Quick update, the IIS6 x86 FastCGI download has been fixed and now contains the full package. Sorry for the troubles.

  8. Anonymous

    Is any information on using the TCP transport mechanism available?

    I’d really like to get this working to improve performance of a python based cgi we’re using.

  9. Anonymous

    I keep getting a:

    FastCGI Handler Extension
    Error 0x80070005 occurred processing request.

    Access is denied.

    Permissions though seem fine. IIS_USR on the root folder and permissions for SYSTEM account on the c:php folder.

    Anyone can help?

  10. Mike Volodarsky


    Is your application pool running as SYSTEM? That is a very bad idea – you should leave it running as Network Service (default). In that case, you have to give Network Service rights to the PHP directory.

    You already have given the anonymous account rights to the PHP scripts you are accessing, which is good (just confirm that IIS_IUSR is your anonymous account). FastCGI will always impersonate the authenticated user, like ASP, if you are using anonymous authentication. Make sure you have anonymous authentication enabled just in case.

    If this doesnt work, then get Process Explorer and monitor the registry / file accesses from the WP, to see what exactly fails. It can also be that PHP.EXE is exiting with access denied – you can confirm this by checking whether PHP.EXE actually starts up on a request, and monitoring its accesses with Process Explorer to see what it fails on.



  11. Anonymous

    If you want the fcgi handler to use the anonymous user credentials to access the .php files in your wwwroot, you have to make sure you have the following line in your php.ini:

    fastcgi.impersonate = 1

    If this line is set to 0, impersonation will not take place. Instead the application pool identity (system, in your case) will be used.

  12. Anonymous

    Does IIS FastCGI handler support connecting to more than one remote instance (via TCP/IP)of the same application to achieve some load balancing magic, and does it support session affinity?

    Amber, best regards!

    [email protected]

  13. Mike Volodarsky


    By default, each FastCGI application pool contains up to 4 child processes (and you can configure it to have any number you want, to have them spun up as needed). When the first process is busy with a request, the second one is chosen to process the next one, and so on, so you get load balancing automatically due to the fact that only one request can be processing in each child process at any given time.

    We do not support affinity, so its impossible to have process state for a client since his requests could end up in different processes. Is this a critical scenario for you?



  14. Anonymous

    Ever since the original release of FastCGI Tech Preview 1 , and the Microsoft/Zend collaboration announcement

  15. Anonymous

    Everybody knows that IIS FastCGI is a great way to run PHP applications on IIS. We’ve been making great strides at delivering a solid production experience for hosting PHP on IIS, for both IIS7 on Windows Vista/Windows Server 2008 and IIS6 / IIS5.1 on

  16. Anonymous

    Right as I was about to go home, one of our developers comes in to tell me some good news about our new IIS7 FastCGI module. So, I figure I would shed some light on our recent work to improve hosting PHP (yes, you read right, PHP) applications on Windows/IIS

  17. Anonymous

    The FastCGI Technical Preview 2 has been released! This is the second release of the FastCGI component for IIS 5, 6, and 7 since the original announcement of Microsoft’s collaboration with Zend to deliver production quality PHP support for IIS on Windows.

  18. Anonymous

    I am new to this blog, I must admit it ranks up there among one of the most unique blog ideas I have ever seen.

  19. Anonymous

    This is a great site. IIS Web server response headers reveal all Web server type, version, file system organization  and IP address.Also Microsoft IIS FastCGI feature  provide  a platform for high-performance and reliable way for different run application frameworks like PHP on IIS .

  20. hello there i need your help if you can help me
    i am having a problem to install php and another problem is all the root folder
    html files became blank

    if you can reply and send me your email will be a plus for more information


Leave a Reply

Your email address will not be published. Required fields are marked *