{"id":49028,"date":"2024-10-08T01:53:16","date_gmt":"2024-10-07T17:53:16","guid":{"rendered":"https:\/\/server.hk\/cnblog\/49028\/"},"modified":"2024-10-08T01:53:16","modified_gmt":"2024-10-07T17:53:16","slug":"windows-2008-r2-%e4%b8%8b-iis-7-5-php-5-2-%e7%92%b0%e5%a2%83%e9%85%8d%e7%bd%ae%ef%bc%88fastcgi-%e8%a8%ad%e7%bd%ae%ef%bc%89","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/49028\/","title":{"rendered":"Windows 2008 R2 \u4e0b IIS 7.5 + PHP 5.2 \u74b0\u5883\u914d\u7f6e\uff08FastCgi \u8a2d\u7f6e\uff09"},"content":{"rendered":"<h1 id=\"windows-2008-r2-%e4%b8%8b-iis-7-5-php-5-2-%e7%92%b0%e5%a2%83%e9%85%8d%e7%bd%ae%ef%bc%88fastcgi-%e8%a8%ad%e7%bd%ae%ef%bc%89-PVXaZFjtGX\">Windows 2008 R2 \u4e0b IIS 7.5 + PHP 5.2 \u74b0\u5883\u914d\u7f6e\uff08FastCgi \u8a2d\u7f6e\uff09<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u7db2\u7d61\u74b0\u5883\u4e2d\uff0c\u8a31\u591a\u7db2\u7ad9\u548c\u61c9\u7528\u7a0b\u5e8f\u90fd\u4f9d\u8cf4\u65bc PHP \u4f5c\u70ba\u5176\u5f8c\u7aef\u8a9e\u8a00\u3002\u5c0d\u65bc\u4f7f\u7528 Windows Server 2008 R2 \u7684\u7528\u6236\u4f86\u8aaa\uff0c\u914d\u7f6e IIS 7.5 \u4ee5\u652f\u6301 PHP 5.2 \u662f\u4e00\u500b\u91cd\u8981\u7684\u6b65\u9a5f\u3002\u672c\u6587\u5c07\u8a73\u7d30\u4ecb\u7d39\u5982\u4f55\u5728 Windows 2008 R2 \u4e0a\u8a2d\u7f6e IIS 7.5 \u548c PHP 5.2 \u74b0\u5883\uff0c\u4e26\u914d\u7f6e FastCGI \u4ee5\u63d0\u9ad8\u6027\u80fd\u3002<\/p>\n<h2 id=\"%e5%ae%89%e8%a3%9d-iis-7-5-PVXaZFjtGX\">\u5b89\u88dd IIS 7.5<\/h2>\n<p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u78ba\u4fdd IIS 7.5 \u5df2\u7d93\u5b89\u88dd\u5728\u60a8\u7684 Windows Server 2008 R2 \u4e0a\u3002\u4ee5\u4e0b\u662f\u5b89\u88dd IIS \u7684\u6b65\u9a5f\uff1a<\/p>\n<ol>\n<li>\u6253\u958b\u201c\u63a7\u5236\u9762\u677f\u201d\u3002<\/li>\n<li>\u9078\u64c7\u201c\u7a0b\u5e8f\u548c\u529f\u80fd\u201d\u3002<\/li>\n<li>\u9ede\u64ca\u201c\u555f\u7528\u6216\u95dc\u9589 Windows \u529f\u80fd\u201d\u3002<\/li>\n<li>\u5728\u5f48\u51fa\u7684\u7a97\u53e3\u4e2d\uff0c\u627e\u5230\u201cInternet Information Services\u201d\uff0c\u52fe\u9078\u5b83\u4e26\u78ba\u4fdd\u9078\u64c7\u4e86\u6240\u6709\u5fc5\u8981\u7684\u529f\u80fd\u3002<\/li>\n<li>\u9ede\u64ca\u201c\u78ba\u5b9a\u201d\u4ee5\u958b\u59cb\u5b89\u88dd\u3002<\/li>\n<\/ol>\n<h2 id=\"%e5%ae%89%e8%a3%9d-php-5-2-PVXaZFjtGX\">\u5b89\u88dd PHP 5.2<\/h2>\n<p>\u63a5\u4e0b\u4f86\uff0c\u60a8\u9700\u8981\u5b89\u88dd PHP 5.2\u3002\u53ef\u4ee5\u5f9e PHP \u7684\u5b98\u65b9\u7db2\u7ad9\u4e0b\u8f09\u76f8\u61c9\u7248\u672c\u7684 PHP\u3002\u4ee5\u4e0b\u662f\u5b89\u88dd\u7684\u6b65\u9a5f\uff1a<\/p>\n<ol>\n<li>\u4e0b\u8f09 PHP 5.2 \u7684 Windows \u5b89\u88dd\u5305\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<li>\u5c07 PHP \u7684\u8def\u5f91\u6dfb\u52a0\u5230\u7cfb\u7d71\u74b0\u5883\u8b8a\u91cf\u4e2d\u3002\u53f3\u9375\u9ede\u64ca\u201c\u8a08\u7b97\u6a5f\u201d\uff0c\u9078\u64c7\u201c\u5c6c\u6027\u201d\uff0c\u7136\u5f8c\u9ede\u64ca\u201c\u9ad8\u7d1a\u7cfb\u7d71\u8a2d\u7f6e\u201d\u3002\u5728\u201c\u7cfb\u7d71\u5c6c\u6027\u201d\u7a97\u53e3\u4e2d\uff0c\u9078\u64c7\u201c\u74b0\u5883\u8b8a\u91cf\u201d\uff0c\u5728\u201c\u7cfb\u7d71\u8b8a\u91cf\u201d\u4e2d\u627e\u5230\u201cPath\u201d\uff0c\u4e26\u6dfb\u52a0 C:PHP\u3002<\/li>\n<\/ol>\n<h2 id=\"%e9%85%8d%e7%bd%ae-fastcgi-PVXaZFjtGX\">\u914d\u7f6e FastCGI<\/h2>\n<p>\u70ba\u4e86\u4f7f PHP \u5728 IIS \u4e2d\u904b\u884c\uff0c\u60a8\u9700\u8981\u914d\u7f6e FastCGI\u3002\u4ee5\u4e0b\u662f\u914d\u7f6e FastCGI \u7684\u6b65\u9a5f\uff1a<\/p>\n<ol>\n<li>\u6253\u958b IIS \u7ba1\u7406\u5668\uff0c\u9078\u64c7\u60a8\u7684\u4f3a\u670d\u5668\u7bc0\u9ede\u3002<\/li>\n<li>\u5728\u4e2d\u9593\u7684\u9762\u677f\u4e2d\uff0c\u96d9\u64ca\u201c\u8655\u7406\u7a0b\u5e8f\u6620\u5c04\u201d\u3002<\/li>\n<li>\u5728\u53f3\u5074\u7684\u64cd\u4f5c\u9762\u677f\u4e2d\uff0c\u9ede\u64ca\u201c\u6dfb\u52a0\u6a21\u584a\u6620\u5c04\u201d\u3002<\/li>\n<li>\u5728\u201c\u8acb\u6c42\u8def\u5f91\u201d\u4e2d\u8f38\u5165 *.php\uff0c\u5728\u201c\u6a21\u584a\u201d\u4e2d\u9078\u64c7 FastCgiModule\uff0c\u5728\u201c\u53ef\u57f7\u884c\u6587\u4ef6\u201d\u4e2d\u8f38\u5165 C:PHPphp-cgi.exe\uff0c\u4e26\u7d66\u9019\u500b\u6620\u5c04\u4e00\u500b\u540d\u7a31\uff0c\u4f8b\u5982 \u201cPHP_via_FastCGI\u201d\u3002<\/li>\n<li>\u9ede\u64ca\u201c\u78ba\u5b9a\u201d\uff0c\u7136\u5f8c\u5728\u5f48\u51fa\u7684\u7a97\u53e3\u4e2d\u9078\u64c7\u201c\u662f\u201d\u4ee5\u5141\u8a31\u5275\u5efa\u65b0\u7684 FastCGI \u61c9\u7528\u7a0b\u5e8f\u3002<\/li>\n<\/ol>\n<h2 id=\"%e8%a8%ad%e7%bd%ae-php-ini-PVXaZFjtGX\">\u8a2d\u7f6e PHP.ini<\/h2>\n<p>\u5728 PHP \u7684\u5b89\u88dd\u76ee\u9304\u4e2d\uff0c\u60a8\u6703\u627e\u5230 php.ini-development \u548c php.ini-production \u5169\u500b\u6587\u4ef6\u3002\u60a8\u9700\u8981\u5c07\u5176\u4e2d\u4e00\u500b\u91cd\u547d\u540d\u70ba php.ini\uff0c\u7136\u5f8c\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>\n; \u8a2d\u7f6e\u6642\u5340\ndate.timezone = \"Asia\/Hong_Kong\"\n\n; \u958b\u555f\u932f\u8aa4\u5831\u544a\ndisplay_errors = On\nerror_reporting = E_ALL\n<\/code><\/pre>\n<h2 id=\"%e6%b8%ac%e8%a9%a6-php-%e7%92%b0%e5%a2%83-PVXaZFjtGX\">\u6e2c\u8a66 PHP \u74b0\u5883<\/h2>\n<p>\u70ba\u4e86\u78ba\u4fdd PHP \u74b0\u5883\u914d\u7f6e\u6b63\u78ba\uff0c\u60a8\u53ef\u4ee5\u5275\u5efa\u4e00\u500b\u7c21\u55ae\u7684 PHP \u6e2c\u8a66\u6587\u4ef6\u3002\u5728\u60a8\u7684\u7db2\u7ad9\u6839\u76ee\u9304\u4e0b\u5275\u5efa\u4e00\u500b\u540d\u70ba info.php \u7684\u6587\u4ef6\uff0c\u4e26\u6dfb\u52a0\u4ee5\u4e0b\u5167\u5bb9\uff1a<\/p>\n<pre><code>\n&lt;?php\nphpinfo();\n?&gt;\n<\/code><\/pre>\n<p>\u7136\u5f8c\u5728\u700f\u89bd\u5668\u4e2d\u8a2a\u554f http:\/\/your-server-ip\/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=\"%e7%b8%bd%e7%b5%90-PVXaZFjtGX\">\u7e3d\u7d50<\/h2>\n<p>\u5728 Windows 2008 R2 \u4e0a\u914d\u7f6e IIS 7.5 \u548c PHP 5.2 \u74b0\u5883\u4e26\u4e0d\u8907\u96dc\uff0c\u53ea\u9700\u6309\u7167\u4e0a\u8ff0\u6b65\u9a5f\u9032\u884c\u64cd\u4f5c\u5373\u53ef\u3002\u9019\u6a23\u7684\u914d\u7f6e\u80fd\u5920\u70ba\u60a8\u7684\u7db2\u7ad9\u63d0\u4f9b\u7a69\u5b9a\u7684\u904b\u884c\u74b0\u5883\u3002\u5982\u679c\u60a8\u9700\u8981\u66f4\u9ad8\u6548\u7684\u89e3\u6c7a\u65b9\u6848\uff0c\u53ef\u4ee5\u8003\u616e\u4f7f\u7528 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u670d\u52d9\uff0c\u9019\u5c07\u70ba\u60a8\u7684\u61c9\u7528\u63d0\u4f9b\u66f4\u597d\u7684\u6027\u80fd\u548c\u7a69\u5b9a\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to configure IIS 7.5 with PHP 5.2 on Windows 2008 R2, including FastCGI setup for optimal performance and compatibility.<\/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-49028","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/49028","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=49028"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/49028\/revisions"}],"predecessor-version":[{"id":49029,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/49028\/revisions\/49029"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=49028"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=49028"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=49028"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}