Webservice on IIS with PHP as FastCGI
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开发者_JS百科
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?
Check you FastCGI Settings.
- Open IIS7 Manager
- Click on the Server and in the Features View select FastCGI Settings
- OPen the php-cgi.exe properties.
- 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
精彩评论