IIS 7 and Above
FastCGI times out on POST when using HttpModules which access Request...
Last post Jul 02, 2010 08:38 AM by lancesh
Jul 01, 2010 08:25 AM|lancesh|LINK
When trying to access the HttpContext.Current.Request.Form collection from within the BeginRequest event of a custom HttpModule during a POST operation the FastCGI process seems to just hang until the timeout is reached. It looks like it's just waiting for
input as FastCGI never actually crashes although IIS reports the error:
The project consists of a .NET form, a PHP form and a single HttpModule:
public class Module : IHttpModule
#region IHttpModule Members
public void Dispose()
public void Init(HttpApplication context)
context.BeginRequest += new EventHandler(context_BeginRequest);
void context_BeginRequest(object sender, EventArgs e)
HttpContext context = HttpContext.Current;
// CAUSES HANG...
var form = context.Request.Form;
$text = '';
$text = $_POST['text'];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<form method="POST" action="<?php echo $_SERVER["REQUEST_URI"] ?>">
<input type="text" name="text" value="<?php echo $text ?>"></input>
<input type="submit" name="send" value="Submit" />
Result: <?php echo $text ?>
I have a basic installation of:
I have also tried this on a number of other Windows 7 and Windows server machines with the same result.
The windows event log, PHP log and IIS log all have no errors reported.
Running a Failed Request Trace proved the most helpful, although it only really shows me that the trace times out with FASTCGI_WAITING_FOR_RESPONSE as the last event.
I was assuming it was something to do with headers but I found it odd that no one else seems to have reported this problem as it is very easy to recreate. Any ideas as to what is causing this would be appreciated - I can provide all code and relevant trace
files on request.
iis7 fastcgi php
PHP IIS7 64bit
Jul 01, 2010 11:54 AM|don.raman|LINK
Please follow my blog at
Jul 02, 2010 08:38 AM|lancesh|LINK
Thanks for your reply.
However, the problem is not that I wan't to increase the timeout length, the problem is that every single POST request times out when using the above code (i.e. with an HttpModule which reads Form values). I am not uploading files, I am simply using an <input/>
control to post a very small piece of text as a test.