{"id":13487,"date":"2021-07-13T06:23:05","date_gmt":"2021-07-12T22:23:05","guid":{"rendered":"http:\/\/blog.idc.net\/13487\/"},"modified":"2022-04-25T15:23:59","modified_gmt":"2022-04-25T07:23:59","slug":"win2k3-iis6-php-with-fastcgi","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/13487\/","title":{"rendered":"Win2K3 IIS6 PHP with FastCGI"},"content":{"rendered":"<div class=\"idc_table\">1\u3001\u4e0b\u8f7d\u5e76\u5b89\u88c5FastCGI Extension for Internet Information Services 6.0 <\/p>\n<p>http:\/\/www.microsoft.com\/downloads\/details.aspx?FamilyID=2d481579-9a7c-4632-b6e6-dee9097f9dc5&amp;displaylang=en <\/p>\n<p>2\u3001\u4e0b\u8f7dphp-5.2.5 <\/p>\n<p>http:\/\/www.php.net\/downloads <\/p>\n<p>\u89e3\u538b\u5230C:\\PHP\u76ee\u5f55\u4e0b<br \/>\n<br \/>\u8981\u786e\u4fddIIS\u542f\u52a8\u5e10\u53f7\u5bf9C:\\PHP\\*\u6709\u8bfb\u53d6\u6267\u884c\u6743\u9650 <\/p>\n<p>3\u3001\u6ce8\u518cPHP\u5230FastCGI<br \/>\n<br \/>cscript fcgiconfig.js -add -section:\"PHP\" -extension:php -path:\"C:\\PHP\\php-cgi.exe\" <\/p>\n<p>4\u3001\u505a\u4e00\u4e9b\u6027\u80fd\u548c\u5b89\u5168\u8bbe\u7f6e<br \/>\n<br \/>C:\\PHP\\php.ini-recommended\u91cd\u547d\u540d\u4e3a\u4e3aC:\\PHP\\php.ini<br \/>\n<br \/>\u6253\u5f00C:\\PHP\\php.ini\uff0c\u4fee\u6539\uff1a<br \/>\n<br \/>extension_dir = \"C:\\PHP\\ext\"<br \/>\n<br \/>fastcgi.impersonate = 1<br \/>\n<br \/>cgi.fix_pathinfo=1<br \/>\n<br \/>cgi.force_redirect = 0<br \/>\n<br \/>\u6267\u884c\uff1a<br \/>\n<br \/>cscript fcgiconfig.js -set -section:\"PHP\" -InstanceMaxRequests:10000<br \/>\n<br \/>cscript fcgiconfig.js -set -section:\"PHP\" -EnvironmentVars:PHP_FCGI_MAX_REQUESTS:10000<br \/>\n<br \/>\u4ee5\u4e0a\u4e24\u9879\u8bbe\u7f6e\u6700\u5927\u6c60\u548c\u54cd\u5e94\u8fde\u63a5\u6570\uff0c\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u786c\u4ef6\u914d\u7f6e\u3001\u4f7f\u7528\u60c5\u51b5\u4fee\u6539 <\/p>\n<p>1. \u5230\u8fd9\u91cc\u4e0b\u8f7d FastCGI \u6700\u65b0 RTM \u7248<br \/>\n<br \/>2. \u5230\u8fd9\u91cc\u4e0b\u8f7d non-thread-safe(\u975e\u5b89\u5168\u7ebf\u7a0b) \u7248\u672c\u7684 PHP (\u76ee\u524d\u6700\u65b0\u7684\u4e3a PHP 5.2.5 Non-thread-safe Win32 binaries)<br \/>\n<br \/>3. \u5c06 PHP \u89e3\u538b\u5230\u4f60\u60f3\u8981\u5b89\u88c5\u7684\u76ee\u5f55\uff0c\u5982 E:\\PHP<br \/>\n<br \/>4. \u5b89\u88c5 FastCGI<br \/>\n<br \/>5. \u914d\u7f6e FastCGI &amp; \u96c6\u6210 PHP<br \/>\n<br \/>\u5f00\u59cb\uff0c\u8fd0\u884c\uff0cCMD<br \/>\n<br \/>cd %WINDIR%\\system32\\inetsrv<br \/>\n<br \/>cscript fcgiconfig.js -add -section:\"PHP\" -extension:php -path:\"E:\\PHP\\php-cgi.exe\"<br \/>\n<br \/>6. \u914d\u7f6e IIS &amp; PHP<br \/>\n<br \/>\u5f00\u59cb\uff0c\u8fd0\u884c\uff0cinetmgr<br \/>\n<br \/>\u4f9d\u6b21\u5c55\u5f00\uff0c\u9009\u4e2d\u8981\u914d\u7f6e\u7684\u7ad9\u70b9\uff0c\u53f3\u952e\uff0c\u5c5e\u6027\u3002<br \/>\n<br \/>\u5207\u6362\u5230\u201c\u4e3b\u76ee\u5f55\u201d\u9009\u9879\u5361\uff0c\u201c\u914d\u7f6e\u201d\uff0c\u201c\u6dfb\u52a0\u201d\uff0c\u201c\u6d4f\u89c8\u201d \u9009\u4e2d C:\\Windows\\system32\\inetsrv\\inetfcgiext.dll\uff0c\u201c\u786e\u5b9a\u201d<br \/>\n<br \/>\u6269\u5c55\u540d\u586b\u5165\u201c.php\u201d\uff0c\u52fe\u9009\u201c\u811a\u672c\u5f15\u64ce\u201d\u53ca\u201c\u68c0\u67e5\u6587\u4ef6\u662f\u5426\u5b58\u5728\u201d\uff0c\u4e00\u8def\u786e\u5b9a\uff0c\u56de\u5230\u7ad9\u70b9\u5c5e\u6027\u5bf9\u8bdd\u6846\u3002<br \/>\n<br \/>\u5207\u6362\u81f3\u201c\u6587\u6863\u201d\u9009\u9879\u5361\uff0c\u201c\u6dfb\u52a0\u201d\uff0c\u8f93\u5165\u201cindex.php\u201d\uff0c\u4e00\u8def\u786e\u5b9a\u3002 <\/p>\n<p>\u5c06 PHP \u5b89\u88c5\u76ee\u5f55\u4e2d\u7684 php.ini-recommend \u590d\u5236\u4e00\u4efd\uff0c\u5c06\u590d\u672c\u6539\u540d\u4e3a php.ini\uff0c\u5e76\u6253\u5f00\u7f16\u8f91\u3002<br \/>\n<br \/>\u67e5\u627e <\/p>\n<p>extension_dir =<br \/>\n<br \/>\u5c06\u5176\u540e\u5f15\u53f7\u5185\u7684\u5185\u5bb9\u6539\u4e3a\u4f60\u7684 PHP \u6269\u5c55\u76ee\u5f55\uff0c\u5982 E:\\PHP\\ext <\/p>\n<p>extension_dir = \"E:\\PHP\\ext\"<br \/>\n<br \/>\u67e5\u627e fastcgi.impersonate \uff0c\u5e76\u5c06\u5176\u503c\u6539\u4e3a 1\uff0c\u6ce8\u610f\u5c06\u5176\u524d\u9762\u7684;\u6ce8\u91ca\u53bb\u6389<br \/>\n<br \/>\u67e5\u627e cgi.force_redirect \uff0c\u5e76\u5c06\u5176\u503c\u7f6e\u4e3a 0\uff0c\u6ce8\u610f\u53bb\u6389; <\/p>\n<p>OK\uff0c\u5927\u529f\u544a\u6210\uff0c\u5728\u4f60\u7684\u7ad9\u70b9\u4e2d\u653e\u4e00\u4e2a\u6d4b\u8bd5\u6587\u4ef6\u8fd0\u884c\u770b\u770b <\/p>\n<p>&lt;?php phpinfo(); ?&gt;<br \/>\n<span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001\u4e0b\u8f7d\u5e76\u5b89\u88c5FastCGI Extension for Internet Information Servi [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[40,26],"tags":[],"class_list":["post-13487","post","type-post","status-publish","format-standard","hentry","category-iis","category-windows"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/13487","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=13487"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/13487\/revisions"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=13487"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=13487"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=13487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}