{"id":47638,"date":"2024-10-07T15:20:16","date_gmt":"2024-10-07T07:20:16","guid":{"rendered":"https:\/\/server.hk\/cnblog\/47638\/"},"modified":"2024-10-07T15:20:16","modified_gmt":"2024-10-07T07:20:16","slug":"iis%e6%96%b0%e6%89%8b%e6%8c%87%e5%8d%97%ef%bc%9a%e9%85%8d%e7%bd%aeiis%e4%bb%a5%e4%bd%bf%e7%94%a8php","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/47638\/","title":{"rendered":"IIS\u65b0\u624b\u6307\u5357\uff1a\u914d\u7f6eIIS\u4ee5\u4f7f\u7528PHP"},"content":{"rendered":"<h1 id=\"iis%e6%96%b0%e6%89%8b%e6%8c%87%e5%8d%97%ef%bc%9a%e9%85%8d%e7%bd%aeiis%e4%bb%a5%e4%bd%bf%e7%94%a8php-aUebxkNEQx\">IIS\u65b0\u624b\u6307\u5357\uff1a\u914d\u7f6eIIS\u4ee5\u4f7f\u7528PHP<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u7db2\u7d61\u74b0\u5883\u4e2d\uff0cIIS\uff08Internet Information Services\uff09\u4f5c\u70ba\u5fae\u8edf\u7684\u7db2\u9801\u4f3a\u670d\u5668\uff0c\u5ee3\u6cdb\u61c9\u7528\u65bc\u5404\u7a2e\u7db2\u7ad9\u548c\u61c9\u7528\u7a0b\u5e8f\u7684\u6258\u7ba1\u3002\u96d6\u7136IIS\u4e3b\u8981\u7528\u65bcASP.NET\u61c9\u7528\uff0c\u4f46\u5b83\u4e5f\u53ef\u4ee5\u914d\u7f6e\u70ba\u652f\u6301PHP\uff0c\u9019\u5c0d\u65bc\u5e0c\u671b\u5728Windows\u74b0\u5883\u4e2d\u904b\u884cPHP\u61c9\u7528\u7684\u958b\u767c\u8005\u4f86\u8aaa\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u5728IIS\u4e0a\u914d\u7f6ePHP\uff0c\u8b93\u65b0\u624b\u80fd\u5920\u8f15\u9b06\u4e0a\u624b\u3002<\/p>\n<h2 id=\"%e5%ae%89%e8%a3%9diis-aUebxkNEQx\">\u5b89\u88ddIIS<\/h2>\n<p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u78ba\u4fdd\u60a8\u7684Windows\u7cfb\u7d71\u4e0a\u5df2\u5b89\u88ddIIS\u3002\u4ee5\u4e0b\u662f\u5b89\u88ddIIS\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\u201d &gt; \u201c\u555f\u7528\u6216\u95dc\u9589Windows\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\u3002<\/li>\n<li>\u9ede\u64ca\u201c\u78ba\u5b9a\u201d\uff0c\u7cfb\u7d71\u5c07\u81ea\u52d5\u5b89\u88ddIIS\u3002<\/li>\n<\/ol>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u53ef\u4ee5\u5728\u700f\u89bd\u5668\u4e2d\u8f38\u5165\u201chttp:\/\/localhost\u201d\u4f86\u6aa2\u67e5IIS\u662f\u5426\u904b\u884c\u6b63\u5e38\u3002<\/p>\n<h2 id=\"%e5%ae%89%e8%a3%9dphp-aUebxkNEQx\">\u5b89\u88ddPHP<\/h2>\n<p>\u63a5\u4e0b\u4f86\uff0c\u60a8\u9700\u8981\u5b89\u88ddPHP\u3002\u53ef\u4ee5\u5f9ePHP\u7684\u5b98\u65b9\u7db2\u7ad9\u4e0b\u8f09\u6700\u65b0\u7248\u672c\u7684PHP\u3002\u4ee5\u4e0b\u662f\u5b89\u88ddPHP\u7684\u6b65\u9a5f\uff1a<\/p>\n<ol>\n<li>\u8a2a\u554f<a href=\"https:\/\/windows.php.net\/download\/\" rel=\"nofollow noopener\" target=\"_blank\">PHP\u5b98\u65b9\u4e0b\u8f09\u9801\u9762<\/a>\uff0c\u9078\u64c7\u9069\u5408\u60a8\u7cfb\u7d71\u7684\u7248\u672c\uff08\u901a\u5e38\u662f\u975e\u57f7\u884c\u6a94\u7684ZIP\u6a94\u6848\uff09\u3002<\/li>\n<li>\u89e3\u58d3\u7e2e\u4e0b\u8f09\u7684ZIP\u6a94\u6848\u5230\u4e00\u500b\u76ee\u9304\uff0c\u4f8b\u5982\u201cC:PHP\u201d\u3002<\/li>\n<li>\u5c07PHP\u7684\u8def\u5f91\u6dfb\u52a0\u5230\u7cfb\u7d71\u74b0\u5883\u8b8a\u91cf\u4e2d\uff0c\u4ee5\u4fbf\u5728\u547d\u4ee4\u884c\u4e2d\u4f7f\u7528PHP\u3002<\/li>\n<\/ol>\n<h2 id=\"%e9%85%8d%e7%bd%aeiis%e4%bb%a5%e6%94%af%e6%8c%81php-aUebxkNEQx\">\u914d\u7f6eIIS\u4ee5\u652f\u6301PHP<\/h2>\n<p>\u5b89\u88dd\u5b8cPHP\u5f8c\uff0c\u60a8\u9700\u8981\u914d\u7f6eIIS\u4ee5\u652f\u6301PHP\u3002\u9019\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u6b65\u9a5f\u5b8c\u6210\uff1a<\/p>\n<ol>\n<li>\u6253\u958bIIS\u7ba1\u7406\u5668\uff0c\u9078\u64c7\u60a8\u7684\u4f3a\u670d\u5668\u7bc0\u9ede\u3002<\/li>\n<li>\u5728\u53f3\u5074\u7684\u64cd\u4f5c\u9762\u677f\u4e2d\uff0c\u9078\u64c7\u201c\u8655\u7406\u7a0b\u5e8f\u6620\u5c04\u201d\u3002<\/li>\n<li>\u9ede\u64ca\u201c\u6dfb\u52a0\u6a21\u584a\u6620\u5c04\u201d\u3002<\/li>\n<li>\u5728\u5f48\u51fa\u7684\u7a97\u53e3\u4e2d\uff0c\u586b\u5beb\u4ee5\u4e0b\u4fe1\u606f\uff1a<\/li>\n<ul>\n<li><strong>\u8acb\u6c42\u8def\u5f91\uff1a<\/strong>*.php<\/li>\n<li><strong>\u6a21\u584a\uff1a<\/strong>FastCgiModule<\/li>\n<li><strong>\u53ef\u57f7\u884c\u6a94\uff1a<\/strong>C:PHPphp-cgi.exe<\/li>\n<li><strong>\u540d\u7a31\uff1a<\/strong>PHP via FastCGI<\/li>\n<\/ul>\n<li>\u9ede\u64ca\u201c\u78ba\u5b9a\u201d\uff0c\u7136\u5f8c\u5728\u63d0\u793a\u4e2d\u9078\u64c7\u201c\u662f\u201d\u4ee5\u5275\u5efaFastCGI\u61c9\u7528\u7a0b\u5e8f\u3002<\/li>\n<\/ol>\n<h2 id=\"%e6%b8%ac%e8%a9%a6php%e9%85%8d%e7%bd%ae-aUebxkNEQx\">\u6e2c\u8a66PHP\u914d\u7f6e<\/h2>\n<p>\u70ba\u4e86\u78ba\u4fddPHP\u5df2\u6b63\u78ba\u914d\u7f6e\uff0c\u60a8\u53ef\u4ee5\u5275\u5efa\u4e00\u500b\u7c21\u55ae\u7684PHP\u6e2c\u8a66\u6587\u4ef6\uff1a<\/p>\n<pre><code>&lt;?php\nphpinfo();\n?&gt;<\/code><\/pre>\n<p>\u5c07\u4e0a\u8ff0\u4ee3\u78bc\u4fdd\u5b58\u70ba\u201cinfo.php\u201d\uff0c\u4e26\u5c07\u5176\u653e\u7f6e\u5728IIS\u7684\u6839\u76ee\u9304\uff08\u901a\u5e38\u662f\u201cC:inetpubwwwroot\u201d\uff09\u4e2d\u3002\u7136\u5f8c\u5728\u700f\u89bd\u5668\u4e2d\u8f38\u5165\u201chttp:\/\/localhost\/info.php\u201d\u3002\u5982\u679c\u4e00\u5207\u6b63\u5e38\uff0c\u60a8\u5c07\u770b\u5230PHP\u7684\u914d\u7f6e\u4fe1\u606f\u9801\u9762\u3002<\/p>\n<h2 id=\"%e5%b8%b8%e8%a6%8b%e5%95%8f%e9%a1%8c-aUebxkNEQx\">\u5e38\u898b\u554f\u984c<\/h2>\n<h3 id=\"1-%e7%82%ba%e4%bb%80%e9%ba%bc%e6%88%91%e7%9a%84php%e9%a0%81%e9%9d%a2%e9%a1%af%e7%a4%ba%e7%82%ba%e7%b4%94%e6%96%87%e6%9c%ac%ef%bc%9f-aUebxkNEQx\">1. \u70ba\u4ec0\u9ebc\u6211\u7684PHP\u9801\u9762\u986f\u793a\u70ba\u7d14\u6587\u672c\uff1f<\/h3>\n<p>\u9019\u901a\u5e38\u662f\u56e0\u70baIIS\u672a\u6b63\u78ba\u914d\u7f6ePHP\u8655\u7406\u7a0b\u5e8f\u3002\u8acb\u6aa2\u67e5\u8655\u7406\u7a0b\u5e8f\u6620\u5c04\u8a2d\u7f6e\uff0c\u78ba\u4fdd\u5df2\u6b63\u78ba\u6dfb\u52a0PHP\u7684\u6a21\u584a\u6620\u5c04\u3002<\/p>\n<h3 id=\"2-%e5%a6%82%e4%bd%95%e8%a7%a3%e6%b1%baphp%e9%8c%af%e8%aa%a4%ef%bc%9f-aUebxkNEQx\">2. \u5982\u4f55\u89e3\u6c7aPHP\u932f\u8aa4\uff1f<\/h3>\n<p>\u60a8\u53ef\u4ee5\u67e5\u770bIIS\u7684\u65e5\u8a8c\u6587\u4ef6\uff0c\u901a\u5e38\u4f4d\u65bc\u201cC:inetpublogsLogFiles\u201d\u4e2d\uff0c\u9019\u53ef\u4ee5\u5e6b\u52a9\u60a8\u8a3a\u65b7\u554f\u984c\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-aUebxkNEQx\">\u7e3d\u7d50<\/h2>\n<p>\u901a\u904e\u4ee5\u4e0a\u6b65\u9a5f\uff0c\u60a8\u61c9\u8a72\u80fd\u5920\u5728IIS\u4e0a\u6210\u529f\u914d\u7f6ePHP\uff0c\u4e26\u958b\u59cb\u958b\u767c\u60a8\u7684\u61c9\u7528\u7a0b\u5e8f\u3002\u7121\u8ad6\u60a8\u662f\u65b0\u624b\u9084\u662f\u6709\u7d93\u9a57\u7684\u958b\u767c\u8005\uff0c\u9019\u4e9b\u57fa\u672c\u7684\u914d\u7f6e\u6b65\u9a5f\u90fd\u80fd\u5e6b\u52a9\u60a8\u5728Windows\u74b0\u5883\u4e2d\u904b\u884cPHP\u61c9\u7528\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\u7db2\u7ad9\uff0c\u9019\u6a23\u53ef\u4ee5\u7372\u5f97\u66f4\u597d\u7684\u6027\u80fd\u548c\u7a69\u5b9a\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b66\u4e60\u5982\u4f55\u914d\u7f6eIIS\u4ee5\u652f\u6301PHP\uff0c\u9002\u5408\u65b0\u624b\u7684\u8be6\u7ec6\u6307\u5357\uff0c\u52a9\u4f60\u8f7b\u677e\u642d\u5efaPHP\u7f51\u7ad9\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-47638","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/47638","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=47638"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/47638\/revisions"}],"predecessor-version":[{"id":47639,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/47638\/revisions\/47639"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=47638"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=47638"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=47638"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}