{"id":49122,"date":"2024-10-08T02:32:17","date_gmt":"2024-10-07T18:32:17","guid":{"rendered":"https:\/\/server.hk\/cnblog\/49122\/"},"modified":"2024-10-08T02:32:17","modified_gmt":"2024-10-07T18:32:17","slug":"iis-7-fastcgi-%e6%96%b9%e5%bc%8f%e5%ae%89%e8%a3%9d-php","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/49122\/","title":{"rendered":"IIS 7 FastCGI \u65b9\u5f0f\u5b89\u88dd PHP"},"content":{"rendered":"<h1 id=\"iis-7-fastcgi-%e6%96%b9%e5%bc%8f%e5%ae%89%e8%a3%9d-php-ZTwikqPSZG\">IIS 7 FastCGI \u65b9\u5f0f\u5b89\u88dd 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\u7279\u5225\u9069\u5408\u65bc\u7db2\u9801\u958b\u767c\u3002\u5c0d\u65bc\u4f7f\u7528 Windows Server \u7684\u7528\u6236\u4f86\u8aaa\uff0cIIS\uff08Internet Information Services\uff09\u662f\u6700\u5e38\u898b\u7684\u7db2\u9801\u4f3a\u670d\u5668\u4e4b\u4e00\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u5728 IIS 7 \u4e0a\u4f7f\u7528 FastCGI \u5b89\u88dd PHP\uff0c\u8b93\u60a8\u80fd\u5920\u9ad8\u6548\u5730\u904b\u884c PHP \u61c9\u7528\u7a0b\u5f0f\u3002<\/p>\n<h2 id=\"%e4%bb%80%e9%ba%bc%e6%98%af-fastcgi%ef%bc%9f-ZTwikqPSZG\">\u4ec0\u9ebc\u662f FastCGI\uff1f<\/h2>\n<p>FastCGI \u662f\u4e00\u7a2e\u589e\u5f37\u7248\u7684 CGI\uff08Common Gateway Interface\uff09\uff0c\u5b83\u80fd\u5920\u63d0\u9ad8\u7db2\u9801\u4f3a\u670d\u5668\u7684\u6027\u80fd\u3002\u8207\u50b3\u7d71\u7684 CGI \u76f8\u6bd4\uff0cFastCGI \u5141\u8a31 PHP \u9032\u7a0b\u6301\u4e45\u904b\u884c\uff0c\u9019\u6a23\u53ef\u4ee5\u6e1b\u5c11\u6bcf\u6b21\u8acb\u6c42\u6642\u7684\u555f\u52d5\u958b\u92b7\uff0c\u5f9e\u800c\u63d0\u9ad8\u97ff\u61c9\u901f\u5ea6\u548c\u6574\u9ad4\u6027\u80fd\u3002<\/p>\n<h2 id=\"%e5%ae%89%e8%a3%9d%e6%ad%a5%e9%a9%9f-ZTwikqPSZG\">\u5b89\u88dd\u6b65\u9a5f<\/h2>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-1%ef%bc%9a%e5%ae%89%e8%a3%9d-iis-7-ZTwikqPSZG\">\u6b65\u9a5f 1\uff1a\u5b89\u88dd IIS 7<\/h3>\n<ul>\n<li>\u6253\u958b\u300c\u63a7\u5236\u9762\u677f\u300d\uff0c\u9078\u64c7\u300c\u7a0b\u5f0f\u548c\u529f\u80fd\u300d\u3002<\/li>\n<li>\u9ede\u64ca\u300c\u555f\u7528\u6216\u95dc\u9589 Windows \u529f\u80fd\u300d\u3002<\/li>\n<li>\u5728\u5f48\u51fa\u7684\u7a97\u53e3\u4e2d\uff0c\u627e\u5230\u300cInternet Information Services\u300d\uff0c\u52fe\u9078\u5b83\u4e26\u9ede\u64ca\u300c\u78ba\u5b9a\u300d\u3002<\/li>\n<\/ul>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-2%ef%bc%9a%e5%ae%89%e8%a3%9d-fastcgi-ZTwikqPSZG\">\u6b65\u9a5f 2\uff1a\u5b89\u88dd FastCGI<\/h3>\n<ul>\n<li>\u5728 IIS \u7ba1\u7406\u5668\u4e2d\uff0c\u9078\u64c7\u60a8\u7684\u4f3a\u670d\u5668\u7bc0\u9ede\u3002<\/li>\n<li>\u5728\u53f3\u5074\u7684\u529f\u80fd\u8996\u7a97\u4e2d\uff0c\u627e\u5230\u300c\u8655\u7406\u7a0b\u5e8f\u96c6\u300d\uff0c\u7136\u5f8c\u9ede\u64ca\u300c\u6dfb\u52a0\u6a21\u7d44\u6620\u5c04\u300d\u3002<\/li>\n<li>\u5728\u300c\u8acb\u6c42\u8def\u5f91\u300d\u4e2d\u8f38\u5165 <code>*.php<\/code>\uff0c\u5728\u300c\u6a21\u7d44\u300d\u4e2d\u9078\u64c7 <code>FastCgiModule<\/code>\uff0c\u4e26\u5728\u300c\u53ef\u57f7\u884c\u6a94\u300d\u4e2d\u8f38\u5165 PHP \u7684\u5b89\u88dd\u8def\u5f91\uff0c\u4f8b\u5982 <code>C:PHPphp-cgi.exe<\/code>\u3002<\/li>\n<li>\u9ede\u64ca\u300c\u78ba\u5b9a\u300d\uff0c\u7136\u5f8c\u5728\u5f48\u51fa\u7684\u7a97\u53e3\u4e2d\u9078\u64c7\u300c\u662f\u300d\u4ee5\u5275\u5efa FastCGI \u61c9\u7528\u7a0b\u5f0f\u3002<\/li>\n<\/ul>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-3%ef%bc%9a%e4%b8%8b%e8%bc%89%e4%b8%a6%e5%ae%89%e8%a3%9d-php-ZTwikqPSZG\">\u6b65\u9a5f 3\uff1a\u4e0b\u8f09\u4e26\u5b89\u88dd PHP<\/h3>\n<ul>\n<li>\u8a2a\u554f PHP \u7684\u5b98\u65b9\u7db2\u7ad9\uff0c\u4e0b\u8f09\u9069\u5408\u60a8\u7cfb\u7d71\u7684 PHP \u7248\u672c\u3002<\/li>\n<li>\u89e3\u58d3\u7e2e\u4e0b\u8f09\u7684\u6587\u4ef6\u5230\u4e00\u500b\u76ee\u9304\uff0c\u4f8b\u5982 <code>C:PHP<\/code>\u3002<\/li>\n<li>\u78ba\u4fdd\u5c07 PHP \u7684\u8def\u5f91\u6dfb\u52a0\u5230\u7cfb\u7d71\u74b0\u5883\u8b8a\u91cf\u4e2d\uff0c\u4ee5\u4fbf\u5728\u547d\u4ee4\u884c\u4e2d\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 PHP\u3002<\/li>\n<\/ul>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-4%ef%bc%9a%e9%85%8d%e7%bd%ae-php-ini-ZTwikqPSZG\">\u6b65\u9a5f 4\uff1a\u914d\u7f6e PHP.ini<\/h3>\n<ul>\n<li>\u5728 PHP \u7684\u5b89\u88dd\u76ee\u9304\u4e2d\uff0c\u627e\u5230 <code>php.ini-development<\/code> \u6216 <code>php.ini-production<\/code> \u6587\u4ef6\uff0c\u5c07\u5176\u8907\u88fd\u4e26\u91cd\u547d\u540d\u70ba <code>php.ini<\/code>\u3002<\/li>\n<li>\u6839\u64da\u9700\u8981\u4fee\u6539 <code>php.ini<\/code> \u6587\u4ef6\uff0c\u4f8b\u5982\u555f\u7528\u64f4\u5c55\u3001\u8a2d\u7f6e\u6642\u5340\u7b49\u3002<\/li>\n<\/ul>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-5%ef%bc%9a%e6%b8%ac%e8%a9%a6-php-%e5%ae%89%e8%a3%9d-ZTwikqPSZG\">\u6b65\u9a5f 5\uff1a\u6e2c\u8a66 PHP \u5b89\u88dd<\/h3>\n<ul>\n<li>\u5728 IIS \u4e2d\uff0c\u5275\u5efa\u4e00\u500b\u65b0\u7684\u7db2\u7ad9\u6216\u61c9\u7528\u7a0b\u5f0f\uff0c\u4e26\u5c07\u5176\u6307\u5411\u4e00\u500b\u76ee\u9304\u3002<\/li>\n<li>\u5728\u8a72\u76ee\u9304\u4e2d\u5275\u5efa\u4e00\u500b\u540d\u70ba <code>info.php<\/code> \u7684\u6587\u4ef6\uff0c\u5167\u5bb9\u5982\u4e0b\uff1a<\/li>\n<\/ul>\n<pre><code>&lt;?php\nphpinfo();\n?&gt;<\/code><\/pre>\n<ul>\n<li>\u5728\u700f\u89bd\u5668\u4e2d\u8a2a\u554f <code>http:\/\/localhost\/info.php<\/code>\uff0c\u5982\u679c\u4e00\u5207\u6b63\u5e38\uff0c\u60a8\u5c07\u770b\u5230 PHP \u7684\u914d\u7f6e\u4fe1\u606f\u9801\u9762\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%b8%b8%e8%a6%8b%e5%95%8f%e9%a1%8c-ZTwikqPSZG\">\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-%e9%a0%81%e9%9d%a2%e9%a1%af%e7%a4%ba%e7%82%ba%e4%b8%8b%e8%bc%89%ef%bc%9f-ZTwikqPSZG\">1. \u70ba\u4ec0\u9ebc\u6211\u7684 PHP \u9801\u9762\u986f\u793a\u70ba\u4e0b\u8f09\uff1f<\/h3>\n<p>\u9019\u901a\u5e38\u662f\u56e0\u70ba IIS \u6c92\u6709\u6b63\u78ba\u8b58\u5225 PHP \u6587\u4ef6\u3002\u8acb\u6aa2\u67e5 FastCGI \u7684\u914d\u7f6e\u662f\u5426\u6b63\u78ba\uff0c\u4e26\u78ba\u4fdd PHP \u7684\u8def\u5f91\u8a2d\u7f6e\u7121\u8aa4\u3002<\/p>\n<h3 id=\"2-%e5%a6%82%e4%bd%95%e5%95%9f%e7%94%a8-php-%e6%93%b4%e5%b1%95%ef%bc%9f-ZTwikqPSZG\">2. \u5982\u4f55\u555f\u7528 PHP \u64f4\u5c55\uff1f<\/h3>\n<p>\u60a8\u53ef\u4ee5\u5728 <code>php.ini<\/code> \u6587\u4ef6\u4e2d\u627e\u5230\u64f4\u5c55\u7684\u8a2d\u7f6e\uff0c\u5c07\u9700\u8981\u7684\u64f4\u5c55\u524d\u9762\u7684\u5206\u865f\u53bb\u6389\u5373\u53ef\u555f\u7528\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-ZTwikqPSZG\">\u7e3d\u7d50<\/h2>\n<p>\u901a\u904e\u4ee5\u4e0a\u6b65\u9a5f\uff0c\u60a8\u61c9\u8a72\u80fd\u5920\u5728 IIS 7 \u4e0a\u6210\u529f\u5b89\u88dd PHP \u4e26\u4f7f\u7528 FastCGI \u9032\u884c\u9ad8\u6548\u7684\u8655\u7406\u3002\u9019\u4e0d\u50c5\u80fd\u63d0\u9ad8\u7db2\u7ad9\u7684\u6027\u80fd\uff0c\u9084\u80fd\u70ba\u60a8\u7684\u958b\u767c\u5de5\u4f5c\u63d0\u4f9b\u4fbf\u5229\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\u6258\u7ba1\u60a8\u7684\u61c9\u7528\u7a0b\u5f0f\uff0c\u4eab\u53d7\u66f4\u7a69\u5b9a\u7684\u670d\u52d9\u548c\u66f4\u5feb\u7684\u97ff\u61c9\u901f\u5ea6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to install PHP using FastCGI on IIS 7 for improved performance and seamless integration. Step-by-step guide included.<\/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-49122","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/49122","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=49122"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/49122\/revisions"}],"predecessor-version":[{"id":49123,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/49122\/revisions\/49123"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=49122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=49122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=49122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}