{"id":48774,"date":"2024-10-08T00:07:15","date_gmt":"2024-10-07T16:07:15","guid":{"rendered":"https:\/\/server.hk\/cnblog\/48774\/"},"modified":"2024-10-08T00:07:15","modified_gmt":"2024-10-07T16:07:15","slug":"%e7%b4%94%e6%89%8b%e5%b7%a5%e9%85%8d%e7%bd%ae-iis-6-%e4%b8%8b-fastcgi-%e7%9a%84-php","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/48774\/","title":{"rendered":"\u7d14\u624b\u5de5\u914d\u7f6e IIS 6 \u4e0b FastCGI \u7684 PHP"},"content":{"rendered":"<h1 id=\"%e7%b4%94%e6%89%8b%e5%b7%a5%e9%85%8d%e7%bd%ae-iis-6-%e4%b8%8b-fastcgi-%e7%9a%84-php-VpFzmTdePv\">\u7d14\u624b\u5de5\u914d\u7f6e IIS 6 \u4e0b FastCGI \u7684 PHP<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u7db2\u7d61\u74b0\u5883\u4e2d\uff0cPHP \u662f\u4e00\u7a2e\u5ee3\u6cdb\u4f7f\u7528\u7684\u4f3a\u670d\u5668\u7aef\u8173\u672c\u8a9e\u8a00\uff0c\u5c24\u5176\u9069\u5408\u65bc\u52d5\u614b\u7db2\u7ad9\u7684\u958b\u767c\u3002\u96d6\u7136\u8a31\u591a\u958b\u767c\u8005\u9078\u64c7\u4f7f\u7528 Apache \u4f5c\u70ba\u5176\u7db2\u9801\u4f3a\u670d\u5668\uff0c\u4f46\u5728\u67d0\u4e9b\u60c5\u6cc1\u4e0b\uff0c\u4f7f\u7528 Microsoft \u7684 IIS\uff08Internet Information Services\uff09\u4e5f\u662f\u4e00\u500b\u4e0d\u932f\u7684\u9078\u64c7\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u5728 IIS 6 \u74b0\u5883\u4e0b\u624b\u52d5\u914d\u7f6e FastCGI \u4ee5\u904b\u884c PHP\u3002<\/p>\n<h2 id=\"%e7%82%ba%e4%bb%80%e9%ba%bc%e9%81%b8%e6%93%87-iis-6-%e5%92%8c-fastcgi%ef%bc%9f-VpFzmTdePv\">\u70ba\u4ec0\u9ebc\u9078\u64c7 IIS 6 \u548c FastCGI\uff1f<\/h2>\n<p>IIS 6 \u662f\u4e00\u500b\u7a69\u5b9a\u4e14\u9ad8\u6548\u7684\u7db2\u9801\u4f3a\u670d\u5668\uff0c\u7279\u5225\u9069\u5408\u65bc Windows \u74b0\u5883\u3002FastCGI \u662f\u4e00\u7a2e\u6539\u9032\u7684 CGI\uff08Common Gateway Interface\uff09\u5354\u8b70\uff0c\u80fd\u5920\u63d0\u9ad8 PHP \u7684\u57f7\u884c\u6548\u7387\uff0c\u6e1b\u5c11\u4f3a\u670d\u5668\u7684\u8cc7\u6e90\u6d88\u8017\u3002\u9019\u4f7f\u5f97\u5728 IIS 6 \u4e0a\u904b\u884c PHP \u6210\u70ba\u4e00\u500b\u53ef\u884c\u7684\u9078\u64c7\uff0c\u5c24\u5176\u662f\u5728\u9700\u8981\u9ad8\u6027\u80fd\u7684\u61c9\u7528\u5834\u666f\u4e2d\u3002<\/p>\n<h2 id=\"%e5%ae%89%e8%a3%9d-php-VpFzmTdePv\">\u5b89\u88dd PHP<\/h2>\n<p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u4e0b\u8f09 PHP \u7684 Windows \u7248\u672c\u3002\u53ef\u4ee5\u5f9e PHP \u7684\u5b98\u65b9\u7db2\u7ad9\u7372\u53d6\u6700\u65b0\u7248\u672c\u7684 PHP\u3002\u4e0b\u8f09\u5f8c\uff0c\u5c07\u5176\u89e3\u58d3\u7e2e\u5230\u60a8\u5e0c\u671b\u5b89\u88dd\u7684\u76ee\u9304\uff0c\u4f8b\u5982\uff1aC:PHP\u3002<\/p>\n<h2 id=\"%e9%85%8d%e7%bd%ae-iis-6-VpFzmTdePv\">\u914d\u7f6e IIS 6<\/h2>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-1%ef%bc%9a%e5%95%9f%e7%94%a8-fastcgi-VpFzmTdePv\">\u6b65\u9a5f 1\uff1a\u555f\u7528 FastCGI<\/h3>\n<ul>\n<li>\u6253\u958b IIS \u7ba1\u7406\u5668\u3002<\/li>\n<li>\u53f3\u9375\u55ae\u64ca\u60a8\u7684\u7db2\u7ad9\uff0c\u9078\u64c7\u300c\u5c6c\u6027\u300d\u3002<\/li>\n<li>\u5728\u300c\u4e3b\u76ee\u9304\u300d\u9078\u9805\u5361\u4e2d\uff0c\u9ede\u64ca\u300c\u914d\u7f6e\u300d\u3002<\/li>\n<li>\u5728\u300c\u61c9\u7528\u7a0b\u5f0f\u914d\u7f6e\u300d\u5c0d\u8a71\u6846\u4e2d\uff0c\u9078\u64c7\u300c\u6dfb\u52a0\u300d\u4ee5\u65b0\u589e\u4e00\u500b\u61c9\u7528\u7a0b\u5f0f\u3002<\/li>\n<li>\u5728\u300c\u53ef\u57f7\u884c\u6a94\u300d\u6b04\u4f4d\u4e2d\uff0c\u8f38\u5165 PHP \u7684\u57f7\u884c\u6a94\u8def\u5f91\uff0c\u4f8b\u5982\uff1aC:PHPphp-cgi.exe\u3002<\/li>\n<li>\u78ba\u4fdd\u9078\u64c7\u300c\u4f7f\u7528 FastCGI\u300d\u9078\u9805\u3002<\/li>\n<\/ul>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-2%ef%bc%9a%e8%a8%ad%e7%bd%ae-php-ini-VpFzmTdePv\">\u6b65\u9a5f 2\uff1a\u8a2d\u7f6e PHP.ini<\/h3>\n<p>\u5728 PHP \u7684\u5b89\u88dd\u76ee\u9304\u4e2d\uff0c\u60a8\u6703\u627e\u5230 php.ini-development \u548c php.ini-production \u5169\u500b\u7bc4\u672c\u6587\u4ef6\u3002\u6839\u64da\u60a8\u7684\u9700\u6c42\uff0c\u5c07\u5176\u4e2d\u4e00\u500b\u91cd\u547d\u540d\u70ba php.ini\uff0c\u4e26\u6839\u64da\u9700\u8981\u9032\u884c\u914d\u7f6e\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u898b\u7684\u914d\u7f6e\u9078\u9805\uff1a<\/p>\n<pre><code>extension_dir = \"C:PHPext\"\nerror_reporting = E_ALL\ndisplay_errors = On\n<\/code><\/pre>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-3%ef%bc%9a%e8%a8%ad%e7%bd%ae-mime-%e9%a1%9e%e5%9e%8b-VpFzmTdePv\">\u6b65\u9a5f 3\uff1a\u8a2d\u7f6e MIME \u985e\u578b<\/h3>\n<ul>\n<li>\u5728 IIS \u7ba1\u7406\u5668\u4e2d\uff0c\u53f3\u9375\u55ae\u64ca\u60a8\u7684\u7db2\u7ad9\uff0c\u9078\u64c7\u300c\u5c6c\u6027\u300d\u3002<\/li>\n<li>\u8f49\u5230\u300cHTTP \u6a19\u982d\u300d\u9078\u9805\u5361\uff0c\u9ede\u64ca\u300cMIME \u985e\u578b\u300d\u3002<\/li>\n<li>\u6dfb\u52a0\u65b0\u7684 MIME \u985e\u578b\uff0c\u5c07\u64f4\u5c55\u540d\u8a2d\u7f6e\u70ba .php\uff0c\u4e26\u5c07 MIME \u985e\u578b\u8a2d\u7f6e\u70ba application\/x-httpd-php\u3002<\/li>\n<\/ul>\n<h2 id=\"%e6%b8%ac%e8%a9%a6-php-%e9%85%8d%e7%bd%ae-VpFzmTdePv\">\u6e2c\u8a66 PHP \u914d\u7f6e<\/h2>\n<p>\u5728\u60a8\u7684\u7db2\u7ad9\u6839\u76ee\u9304\u4e2d\u5275\u5efa\u4e00\u500b\u540d\u70ba info.php \u7684\u6587\u4ef6\uff0c\u4e26\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u78bc\uff1a<\/p>\n<pre><code>&lt;?php\nphpinfo();\n?&gt;<\/code><\/pre>\n<p>\u7136\u5f8c\u5728\u700f\u89bd\u5668\u4e2d\u8a2a\u554f http:\/\/yourdomain.com\/info.php\u3002\u5982\u679c\u4e00\u5207\u914d\u7f6e\u6b63\u78ba\uff0c\u60a8\u5c07\u770b\u5230 PHP \u7684\u914d\u7f6e\u4fe1\u606f\u9801\u9762\u3002<\/p>\n<h2 id=\"%e5%b8%b8%e8%a6%8b%e5%95%8f%e9%a1%8c-VpFzmTdePv\">\u5e38\u898b\u554f\u984c<\/h2>\n<h3 id=\"1-%e7%82%ba%e4%bb%80%e9%ba%bc%e6%88%91%e7%9a%84-php-%e8%85%b3%e6%9c%ac%e7%84%a1%e6%b3%95%e5%9f%b7%e8%a1%8c%ef%bc%9f-VpFzmTdePv\">1. \u70ba\u4ec0\u9ebc\u6211\u7684 PHP \u8173\u672c\u7121\u6cd5\u57f7\u884c\uff1f<\/h3>\n<p>\u8acb\u6aa2\u67e5\u60a8\u7684 FastCGI \u914d\u7f6e\u662f\u5426\u6b63\u78ba\uff0c\u4e26\u78ba\u4fdd PHP \u7684\u57f7\u884c\u6a94\u8def\u5f91\u6b63\u78ba\u7121\u8aa4\u3002<\/p>\n<h3 id=\"2-%e5%a6%82%e4%bd%95%e6%9f%a5%e7%9c%8b-php-%e9%8c%af%e8%aa%a4%e6%97%a5%e8%aa%8c%ef%bc%9f-VpFzmTdePv\">2. \u5982\u4f55\u67e5\u770b PHP \u932f\u8aa4\u65e5\u8a8c\uff1f<\/h3>\n<p>\u5728 php.ini \u6587\u4ef6\u4e2d\uff0c\u8a2d\u7f6e error_log \u53c3\u6578\u4ee5\u6307\u5b9a\u932f\u8aa4\u65e5\u8a8c\u7684\u8def\u5f91\uff0c\u4e26\u78ba\u4fdd display_errors \u8a2d\u7f6e\u70ba On \u4ee5\u4fbf\u5728\u958b\u767c\u904e\u7a0b\u4e2d\u986f\u793a\u932f\u8aa4\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-VpFzmTdePv\">\u7e3d\u7d50<\/h2>\n<p>\u5728 IIS 6 \u4e0a\u624b\u52d5\u914d\u7f6e FastCGI \u4ee5\u904b\u884c PHP \u662f\u4e00\u500b\u76f8\u5c0d\u7c21\u55ae\u7684\u904e\u7a0b\uff0c\u901a\u904e\u6b63\u78ba\u7684\u8a2d\u7f6e\uff0c\u60a8\u53ef\u4ee5\u5145\u5206\u5229\u7528 PHP \u7684\u5f37\u5927\u529f\u80fd\u3002\u7121\u8ad6\u60a8\u662f\u958b\u767c\u8005\u9084\u662f\u7cfb\u7d71\u7ba1\u7406\u54e1\uff0c\u4e86\u89e3\u9019\u4e9b\u914d\u7f6e\u6b65\u9a5f\u90fd\u5c07\u5c0d\u60a8\u7684\u5de5\u4f5c\u6709\u6240\u5e6b\u52a9\u3002\u5982\u679c\u60a8\u9700\u8981\u66f4\u9ad8\u6548\u7684\u89e3\u6c7a\u65b9\u6848\uff0c\u8003\u616e\u4f7f\u7528 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u4f86\u63d0\u5347\u60a8\u7684\u7db2\u7ad9\u6027\u80fd\u548c\u7a69\u5b9a\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b78\u7fd2\u5982\u4f55\u5728 IIS 6 \u74b0\u5883\u4e2d\u7d14\u624b\u5de5\u914d\u7f6e FastCGI \u4ee5\u904b\u884c PHP\uff0c\u63d0\u5347\u7db2\u7ad9\u6027\u80fd\u8207\u7a69\u5b9a\u6027\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-48774","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/48774","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=48774"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/48774\/revisions"}],"predecessor-version":[{"id":48775,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/48774\/revisions\/48775"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=48774"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=48774"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=48774"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}