Webservice on IIS with PHP as FastCGI

0

I have PHP web service created with use of Zend_Soap. On apache, or IIS 7 with PHP module as CGI everything works just fine. But if I configure PHP as FastCGI, every second request to web service results in 400 BedRequest response.

I have following bad message communication sniffed with wireshark:

POST /JaR/soapTest/Service.php HTTP/1.1    
Content-Type: text/xml; charset=utf-8    
VsDebuggerCausalityData: uIDPoyo7FNjw0FZJlPkpvI/09dIAAAAA7yLlSSd4sEqSVBHiUG/JW55FahmIOYRAtQ0OUnO49ZoACQAA    
SOAPAction: "http://signia.cz/WebClientCEVO/1.0#QueryByBasicInformation"    
Host: w7pr-xampp-dev:8000    
Content-Length: 971    
Expect: 100-continue    


HTTP/1.1 400 Bad Request    
Content-Type: text/html; charset=us-ascii    
Server: Microsoft-HTTPAPI/2.0    
Date: Thu, 17 Feb 2011 14:03:46 GMT    
Connection: close    
Content-Length: 311    


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">    
<HTML><HEAD><TITLE>Bad Request</TITLE>    
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>    
<BODY><h2>Bad Request</h2>    
<hr><p>HTTP Error 400. The request is badly formed.</p>    
</BODY></HTML>

Later I created trace in iis and figured out, that every first call succeeds, than the second failsllowing fails, which causes the php-cgi.exe proccess to restart. From IIS trace I get following info:

MODULE_SET_RESPONSE_ERROR_STATUS 
ModuleName FastCgiModule 
Notification 128 
HttpStatus 500 
HttpReason Internal Server Error 
HttpSubStatus 0 
ErrorCode 2147942401 
ConfigExceptionInfo  
Notification EXECUTE_REQUEST_HANDLER 
ErrorCode Nesprávná funkce. (0x80070001) 

Next I tried to check out the communication itself with fidler2 proxy, with no real success. When I call the web service with proxy enabled, every call succeeds. fidler2 also prints out warning, that announced length of response from my WS is not the same as the actual length (on apache the lengths are fine).

Have anyone any clue where could lie the problem?

php
web-services
iis-7
fastcgi
asked on Stack Overflow Feb 21, 2011 by Trakhan

1 Answer

0

Check you FastCGI Settings.

  1. Open IIS7 Manager
  2. Click on the Server and in the Features View select FastCGI Settings
  3. OPen the php-cgi.exe properties.
  4. Check the Instance Max Requests, i have mine set to 10000 and you need to add sometings into the Collection property.

Collection object Name = PHP_FCGI_MAX_REQUESTS collection object value = 10000

Hope that works

answered on Stack Overflow Feb 21, 2011 by Robbie Tapping

User contributions licensed under CC BY-SA 3.0