{"id":53365,"date":"2024-10-09T10:36:19","date_gmt":"2024-10-09T02:36:19","guid":{"rendered":"https:\/\/server.hk\/cnblog\/53365\/"},"modified":"2024-10-09T10:36:19","modified_gmt":"2024-10-09T02:36:19","slug":"iis-7-fastcgi-%e6%96%b9%e5%bc%8f%e5%ae%89%e8%a3%9d-php-2","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/53365\/","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-nbYyxBFrVu\">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-nbYyxBFrVu\">\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 \u4e0d\u540c\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-nbYyxBFrVu\">\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-nbYyxBFrVu\">\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\u78ba\u4fdd\u300cWeb \u7ba1\u7406\u5de5\u5177\u300d\u548c\u300c\u842c\u7dad\u7db2\u670d\u52d9\u300d\u90fd\u88ab\u9078\u4e2d\u3002<\/li>\n<li>\u9ede\u64ca\u300c\u78ba\u5b9a\u300d\uff0c\u7b49\u5f85\u5b89\u88dd\u5b8c\u6210\u3002<\/li>\n<\/ul>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-2%ef%bc%9a%e5%ae%89%e8%a3%9d-php-nbYyxBFrVu\">\u6b65\u9a5f 2\uff1a\u5b89\u88dd PHP<\/h3>\n<ul>\n<li>\u8a2a\u554f PHP \u7684\u5b98\u65b9\u7db2\u7ad9\uff08<a href=\"https:\/\/windows.php.net\/download\/\" rel=\"nofollow noopener\" target=\"_blank\">https:\/\/windows.php.net\/download\/<\/a>\uff09\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 C:PHP\u3002<\/li>\n<\/ul>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-3%ef%bc%9a%e9%85%8d%e7%bd%ae-iis-%e4%bb%a5%e6%94%af%e6%8c%81-fastcgi-nbYyxBFrVu\">\u6b65\u9a5f 3\uff1a\u914d\u7f6e IIS \u4ee5\u652f\u6301 FastCGI<\/h3>\n<ul>\n<li>\u6253\u958b IIS \u7ba1\u7406\u5668\uff0c\u9078\u64c7\u60a8\u7684\u4f3a\u670d\u5668\u7bc0\u9ede\u3002<\/li>\n<li>\u5728\u53f3\u5074\u7684\u300c\u529f\u80fd\u8996\u5716\u300d\u4e2d\uff0c\u627e\u5230\u300c\u8655\u7406\u7a0b\u5e8f\u6620\u5c04\u300d\u3002<\/li>\n<li>\u5728\u53f3\u5074\u7684\u64cd\u4f5c\u9762\u677f\u4e2d\uff0c\u9ede\u64ca\u300c\u6dfb\u52a0\u6a21\u7d44\u6620\u5c04\u300d\u3002<\/li>\n<li>\u5728\u5f48\u51fa\u7684\u7a97\u53e3\u4e2d\uff0c\u586b\u5beb\u4ee5\u4e0b\u4fe1\u606f\uff1a<\/li>\n<ul>\n<li>\u8acb\u6c42\u8def\u5f91\uff1a<code>*.php<\/code><\/li>\n<li>\u6a21\u7d44\uff1a<code>FastCgiModule<\/code><\/li>\n<li>\u53ef\u57f7\u884c\u6587\u4ef6\uff1a<code>C:PHPphp-cgi.exe<\/code><\/li>\n<\/li>\n<li>\u540d\u7a31\uff1a<code>PHP via FastCGI<\/code><\/li>\n<\/ul>\n<li>\u9ede\u64ca\u300c\u78ba\u5b9a\u300d\uff0c\u7136\u5f8c\u5728\u63d0\u793a\u4e2d\u9078\u64c7\u300c\u662f\u300d\u4ee5\u5275\u5efa FastCGI \u8a2d\u5b9a\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-nbYyxBFrVu\">\u6b65\u9a5f 4\uff1a\u914d\u7f6e PHP.ini<\/h3>\n<ul>\n<li>\u5728 C:PHP \u76ee\u9304\u4e2d\uff0c\u627e\u5230 <code>php.ini-development<\/code> \u6587\u4ef6\uff0c\u5c07\u5176\u8907\u88fd\u4e26\u91cd\u547d\u540d\u70ba <code>php.ini<\/code>\u3002<\/li>\n<li>\u4f7f\u7528\u6587\u672c\u7de8\u8f2f\u5668\u6253\u958b <code>php.ini<\/code>\uff0c\u6839\u64da\u9700\u8981\u9032\u884c\u914d\u7f6e\uff0c\u4f8b\u5982\u8a2d\u7f6e\u64f4\u5c55\u548c\u932f\u8aa4\u5831\u544a\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-nbYyxBFrVu\">\u6b65\u9a5f 5\uff1a\u6e2c\u8a66 PHP \u5b89\u88dd<\/h3>\n<ul>\n<li>\u5728 C:inetpubwwwroot \u76ee\u9304\u4e2d\uff0c\u5275\u5efa\u4e00\u500b\u540d\u70ba <code>info.php<\/code> \u7684\u6587\u4ef6\uff0c\u4e26\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u78bc\uff1a<\/li>\n<pre><code>&lt;?php\nphpinfo();\n?&gt;<\/code><\/pre>\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-nbYyxBFrVu\">\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-nbYyxBFrVu\">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\u914d\u7f6e PHP \u7684\u8655\u7406\u7a0b\u5e8f\u6620\u5c04\u3002\u8acb\u6aa2\u67e5\u60a8\u5728\u300c\u8655\u7406\u7a0b\u5e8f\u6620\u5c04\u300d\u4e2d\u7684\u8a2d\u7f6e\u662f\u5426\u6b63\u78ba\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-nbYyxBFrVu\">2. \u5982\u4f55\u555f\u7528 PHP \u64f4\u5c55\uff1f<\/h3>\n<p>\u5728 <code>php.ini<\/code> \u6587\u4ef6\u4e2d\uff0c\u627e\u5230\u60a8\u9700\u8981\u7684\u64f4\u5c55\uff0c\u53bb\u6389\u524d\u9762\u7684\u5206\u865f\uff08;\uff09\u4ee5\u555f\u7528\u5b83\u5011\uff0c\u7136\u5f8c\u91cd\u555f IIS\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-nbYyxBFrVu\">\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\u66f4\u597d\u7684\u652f\u6301\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\u6e2f VPS<\/a> \u670d\u52d9\uff0c\u9019\u5c07\u70ba\u60a8\u7684\u7db2\u7ad9\u63d0\u4f9b\u7a69\u5b9a\u7684\u904b\u884c\u74b0\u5883\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to install PHP on IIS 7 using FastCGI for improved performance and efficiency in your web applications. 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-53365","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/53365","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=53365"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/53365\/revisions"}],"predecessor-version":[{"id":53366,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/53365\/revisions\/53366"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=53365"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=53365"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=53365"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}