|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-05-15 17:05 UTC] coder1 at gmail dot com
Description: ------------ isapi_fcgi.dll fails to load PHP properly on WinXP SP2/IIS5.1 There are no errors showing up in the event log. When I configure IIS to php-cgi.exe, the page loads as expected. This was an upgrade from 5.1.2 to 5.1.4. 5.1.2 works OK with the same isapi_fcgi.dll. Additionally, I tested the Zend FastCGI file (zend_fcgi.dll) included with Zend Core. This version of FastCGI works OK. It is Caraveo's version (and my modification originating from this source) which previously worked on 5.1.2 that now fails to work with 5.1.4. Reproduce code: --------------- <? phpinfo(); ?> Expected result: ---------------- Display PHP Information Actual result: -------------- HTTP/1.1 503 Server too busy Server: Microsoft-IIS/5.1 Date: Wed, 10 May 2006 17:09:58 GMT Connection: close Content-Type: text/html Server Error, unable to connect to fastcgi server. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 22 21:00:01 2025 UTC |
I am also able to reproduce this on the current 5.2 branch (built: May 27 2006 16:22:11) with isapi_fcgi.dll (FCGI_SERVER_VERSION = 2.2.2 0.5.2 beta). It appears to be triggered by an echo that is larger than some magic number around 16kB. This code: <?php echo str_repeat(str_repeat("-=-=-=", 20) . "<br>", 131); ?> outputs a page that is 16,244 bytes. If I increase the count to 132 (what would be 16,368 bytes) I get: "HTTP/1.1 503 Server too busy Server: Microsoft-IIS/5.1 Date: Sat, 27 May 2006 15:05:07 GMT X-Powered-By: ASP.NET Connection: close Content-Type: text/html Server Error, unable to connect to fastcgi server."I can verify the above experiment. I got the 5.2 snapshot and used the following: <?php echo str_repeat(str_repeat("-=-=-=", 20) . "<br>", 131); ?> That works fine. But change the 131 to 132 and you get the 503 error. At a loss. daveWith PHP 5.2.0RC6-dev (Oct 19 2006 20:17:20) on WinXP-SP2 <?php echo str_repeat("-", 16340); // ok echo str_repeat("-", 16341); // 503 Server too busy ?>This is not a PHP but isapi_fcgi.dll fault. From quick look into source code fcgi_server.c:373 I see a buffer overflow. contentLength = (Header.contentLengthB1 << 8) + Header.contentLengthB0;// + Header.paddingLength; rcvd = OS_Read(req_info->appServerSock, (char *)&work_buffer, contentLength + Header.paddingLength); work_buffer is declared as "char work_buffer[8192]" so in case if packet length is larger then 8192 bytes isapi_fcgi.dll makes fault. According to FastCGI specification it is legal to use packets up to 65535 bytes, so this is definitely isapi_fcg.dll's problem.