{"id":49102,"date":"2024-10-08T02:24:17","date_gmt":"2024-10-07T18:24:17","guid":{"rendered":"https:\/\/server.hk\/cnblog\/49102\/"},"modified":"2024-10-08T02:24:17","modified_gmt":"2024-10-07T18:24:17","slug":"windows-iis-%e9%85%8d%e7%bd%ae-jsp-%e5%92%8c-php-%e7%92%b0%e5%a2%83%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/49102\/","title":{"rendered":"Windows IIS \u914d\u7f6e JSP \u548c PHP \u74b0\u5883\u65b9\u6cd5"},"content":{"rendered":"<h1 id=\"windows-iis-%e9%85%8d%e7%bd%ae-jsp-%e5%92%8c-php-%e7%92%b0%e5%a2%83%e6%96%b9%e6%b3%95-PvtOAHBfhJ\">Windows IIS \u914d\u7f6e JSP \u548c PHP \u74b0\u5883\u65b9\u6cd5<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u7db2\u7d61\u74b0\u5883\u4e2d\uff0c\u8a31\u591a\u958b\u767c\u8005\u548c\u4f01\u696d\u9078\u64c7\u4f7f\u7528 Windows \u4f3a\u670d\u5668\u4f86\u904b\u884c\u5176\u61c9\u7528\u7a0b\u5e8f\u3002Windows IIS\uff08Internet Information Services\uff09\u662f\u4e00\u500b\u5f37\u5927\u7684\u7db2\u9801\u4f3a\u670d\u5668\uff0c\u652f\u6301\u591a\u7a2e\u6280\u8853\uff0c\u5305\u62ec JSP\uff08JavaServer Pages\uff09\u548c PHP\uff08PHP: Hypertext Preprocessor\uff09\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u5728 Windows IIS \u4e0a\u914d\u7f6e JSP \u548c PHP \u74b0\u5883\uff0c\u5e6b\u52a9\u958b\u767c\u8005\u66f4\u6709\u6548\u5730\u90e8\u7f72\u5176\u61c9\u7528\u7a0b\u5e8f\u3002<\/p>\n<h2 id=\"%e4%b8%80%e3%80%81%e5%ae%89%e8%a3%9d-iis-PvtOAHBfhJ\">\u4e00\u3001\u5b89\u88dd IIS<\/h2>\n<p>\u9996\u5148\uff0c\u78ba\u4fdd\u4f60\u7684 Windows \u7cfb\u7d71\u5df2\u7d93\u5b89\u88dd\u4e86 IIS\u3002\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u6b65\u9a5f\u9032\u884c\u5b89\u88dd\uff1a<\/p>\n<ol>\n<li>\u6253\u958b\u63a7\u5236\u9762\u677f\uff0c\u9078\u64c7\u300c\u7a0b\u5e8f\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<\/ol>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u53ef\u4ee5\u901a\u904e\u5728\u700f\u89bd\u5668\u4e2d\u8f38\u5165 <code>http:\/\/localhost<\/code> \u4f86\u6aa2\u67e5 IIS \u662f\u5426\u904b\u884c\u6b63\u5e38\u3002<\/p>\n<h2 id=\"%e4%ba%8c%e3%80%81%e9%85%8d%e7%bd%ae-php-%e7%92%b0%e5%a2%83-PvtOAHBfhJ\">\u4e8c\u3001\u914d\u7f6e PHP \u74b0\u5883<\/h2>\n<p>\u8981\u5728 IIS \u4e0a\u904b\u884c PHP\uff0c\u9996\u5148\u9700\u8981\u5b89\u88dd PHP\u3002\u4ee5\u4e0b\u662f\u5b89\u88dd\u548c\u914d\u7f6e PHP \u7684\u6b65\u9a5f\uff1a<\/p>\n<h3 id=\"1-%e4%b8%8b%e8%bc%89-php-PvtOAHBfhJ\">1. \u4e0b\u8f09 PHP<\/h3>\n<p>\u8a2a\u554f PHP \u5b98\u65b9\u7db2\u7ad9\uff08<a href=\"https:\/\/windows.php.net\/download\/\" rel=\"nofollow noopener\" target=\"_blank\">https:\/\/windows.php.net\/download\/<\/a>\uff09\u4e0b\u8f09\u9069\u5408\u4f60\u7cfb\u7d71\u7684 PHP \u7248\u672c\u3002\u5efa\u8b70\u9078\u64c7\u300cThread Safe\u300d\u7248\u672c\u3002<\/p>\n<h3 id=\"2-%e8%a7%a3%e5%a3%93%e5%92%8c%e9%85%8d%e7%bd%ae-PvtOAHBfhJ\">2. \u89e3\u58d3\u548c\u914d\u7f6e<\/h3>\n<p>\u5c07\u4e0b\u8f09\u7684 PHP \u6587\u4ef6\u89e3\u58d3\u5230\u4e00\u500b\u76ee\u9304\uff0c\u4f8b\u5982 <code>C:PHP<\/code>\u3002\u63a5\u4e0b\u4f86\uff0c\u5c07\u8a72\u76ee\u9304\u6dfb\u52a0\u5230\u7cfb\u7d71\u7684\u74b0\u5883\u8b8a\u91cf\u4e2d\uff1a<\/p>\n<ol>\n<li>\u53f3\u9375\u9ede\u64ca\u300c\u6b64\u96fb\u8166\u300d\uff0c\u9078\u64c7\u300c\u5c6c\u6027\u300d\u3002<\/li>\n<li>\u9ede\u64ca\u300c\u9ad8\u7d1a\u7cfb\u7d71\u8a2d\u7f6e\u300d\uff0c\u7136\u5f8c\u9078\u64c7\u300c\u74b0\u5883\u8b8a\u91cf\u300d\u3002<\/li>\n<li>\u5728\u300c\u7cfb\u7d71\u8b8a\u91cf\u300d\u4e2d\u627e\u5230\u300cPath\u300d\uff0c\u9ede\u64ca\u300c\u7de8\u8f2f\u300d\uff0c\u7136\u5f8c\u6dfb\u52a0 <code>C:PHP<\/code>\u3002<\/li>\n<\/ol>\n<h3 id=\"3-%e9%85%8d%e7%bd%ae-iis-PvtOAHBfhJ\">3. \u914d\u7f6e IIS<\/h3>\n<p>\u5728 IIS \u4e2d\u914d\u7f6e PHP\uff0c\u9700\u5b89\u88dd PHP Manager\u3002\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u6b65\u9a5f\u9032\u884c\uff1a<\/p>\n<ol>\n<li>\u4e0b\u8f09 PHP Manager for IIS\uff08<a href=\"https:\/\/www.phpmanager.org\/\" rel=\"nofollow noopener\" target=\"_blank\">https:\/\/www.phpmanager.org\/<\/a>\uff09\u3002<\/li>\n<li>\u5b89\u88dd PHP Manager\uff0c\u7136\u5f8c\u5728 IIS \u7ba1\u7406\u5668\u4e2d\u627e\u5230 PHP Manager\u3002<\/li>\n<li>\u4f7f\u7528 PHP Manager \u914d\u7f6e PHP\uff0c\u8a2d\u7f6e PHP \u7684\u7248\u672c\u548c\u5176\u4ed6\u9078\u9805\u3002<\/li>\n<\/ol>\n<h2 id=\"%e4%b8%89%e3%80%81%e9%85%8d%e7%bd%ae-jsp-%e7%92%b0%e5%a2%83-PvtOAHBfhJ\">\u4e09\u3001\u914d\u7f6e JSP \u74b0\u5883<\/h2>\n<p>\u8981\u5728 IIS \u4e0a\u904b\u884c JSP\uff0c\u901a\u5e38\u9700\u8981\u4f7f\u7528 Apache Tomcat \u4f5c\u70ba Servlet \u5bb9\u5668\u3002\u4ee5\u4e0b\u662f\u914d\u7f6e JSP \u7684\u6b65\u9a5f\uff1a<\/p>\n<h3 id=\"1-%e4%b8%8b%e8%bc%89%e5%92%8c%e5%ae%89%e8%a3%9d-tomcat-PvtOAHBfhJ\">1. \u4e0b\u8f09\u548c\u5b89\u88dd Tomcat<\/h3>\n<p>\u8a2a\u554f Apache Tomcat \u5b98\u65b9\u7db2\u7ad9\uff08<a href=\"https:\/\/tomcat.apache.org\/\" rel=\"nofollow noopener\" target=\"_blank\">https:\/\/tomcat.apache.org\/<\/a>\uff09\u4e0b\u8f09\u6700\u65b0\u7248\u672c\u7684 Tomcat\u3002\u89e3\u58d3\u5f8c\uff0c\u5c07\u5176\u653e\u7f6e\u5728\u4e00\u500b\u76ee\u9304\u4e2d\uff0c\u4f8b\u5982 <code>C:Tomcat<\/code>\u3002<\/p>\n<h3 id=\"2-%e9%85%8d%e7%bd%ae-iis-%e8%88%87-tomcat-%e7%9a%84%e9%9b%86%e6%88%90-PvtOAHBfhJ\">2. \u914d\u7f6e IIS \u8207 Tomcat \u7684\u96c6\u6210<\/h3>\n<p>\u70ba\u4e86\u8b93 IIS \u80fd\u5920\u8655\u7406 JSP \u8acb\u6c42\uff0c\u9700\u8981\u4f7f\u7528 ISAPI \u8f49\u63a5\u5668\u3002\u53ef\u4ee5\u4f7f\u7528 <a href=\"https:\/\/tomcat.apache.org\/connectors-doc\/generic\/ISAPI.html\" rel=\"nofollow noopener\" target=\"_blank\">ISAPI Redirector<\/a> \u4f86\u5be6\u73fe\u9019\u4e00\u9ede\u3002\u4ee5\u4e0b\u662f\u57fa\u672c\u6b65\u9a5f\uff1a<\/p>\n<ol>\n<li>\u4e0b\u8f09 ISAPI \u8f49\u63a5\u5668\uff0c\u4e26\u5c07\u5176\u653e\u7f6e\u5728 Tomcat \u7684 <code>lib<\/code> \u76ee\u9304\u4e2d\u3002<\/li>\n<li>\u914d\u7f6e <code>workers.properties<\/code> \u6587\u4ef6\uff0c\u8a2d\u7f6e Tomcat \u7684\u5de5\u4f5c\u8005\u3002<\/li>\n<li>\u5728 IIS \u4e2d\u6dfb\u52a0\u4e00\u500b\u65b0\u7684\u7db2\u7ad9\uff0c\u4e26\u5c07\u5176\u6307\u5411 Tomcat \u7684 <code>webapps<\/code> \u76ee\u9304\u3002<\/li>\n<\/ol>\n<h2 id=\"%e5%9b%9b%e3%80%81%e6%b8%ac%e8%a9%a6%e7%92%b0%e5%a2%83-PvtOAHBfhJ\">\u56db\u3001\u6e2c\u8a66\u74b0\u5883<\/h2>\n<p>\u5b8c\u6210\u4ee5\u4e0a\u914d\u7f6e\u5f8c\uff0c\u53ef\u4ee5\u901a\u904e\u5275\u5efa\u4e00\u500b\u7c21\u55ae\u7684 PHP \u548c JSP \u6587\u4ef6\u4f86\u6e2c\u8a66\u74b0\u5883\u662f\u5426\u6b63\u5e38\u904b\u884c\u3002<\/p>\n<h3 id=\"php-%e6%b8%ac%e8%a9%a6%e6%96%87%e4%bb%b6-PvtOAHBfhJ\">PHP \u6e2c\u8a66\u6587\u4ef6<\/h3>\n<pre><code>&lt;?php\nphpinfo();\n?&gt;<\/code><\/pre>\n<h3 id=\"jsp-%e6%b8%ac%e8%a9%a6%e6%96%87%e4%bb%b6-PvtOAHBfhJ\">JSP \u6e2c\u8a66\u6587\u4ef6<\/h3>\n<pre><code>&lt;%@ page language=\"java\" contentType=\"text\/html; charset=UTF-8\" pageEncoding=\"UTF-8\"%&gt;\n&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n&lt;head&gt;\n    &lt;title&gt;JSP \u6e2c\u8a66&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n    &lt;h1&gt;Hello, JSP!&lt;\/h1&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n<p>\u5c07\u9019\u4e9b\u6587\u4ef6\u653e\u7f6e\u5728\u76f8\u61c9\u7684\u76ee\u9304\u4e2d\uff0c\u7136\u5f8c\u901a\u904e\u700f\u89bd\u5668\u8a2a\u554f\u5b83\u5011\uff0c\u6aa2\u67e5\u662f\u5426\u80fd\u6b63\u5e38\u986f\u793a\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-PvtOAHBfhJ\">\u7e3d\u7d50<\/h2>\n<p>\u5728 Windows IIS \u4e0a\u914d\u7f6e JSP \u548c PHP \u74b0\u5883\u96d6\u7136\u9700\u8981\u4e00\u4e9b\u6b65\u9a5f\uff0c\u4f46\u901a\u904e\u6b63\u78ba\u7684\u5b89\u88dd\u548c\u914d\u7f6e\uff0c\u53ef\u4ee5\u5be6\u73fe\u9ad8\u6548\u7684\u61c9\u7528\u7a0b\u5e8f\u904b\u884c\u3002\u7121\u8ad6\u662f\u4f7f\u7528 PHP \u9084\u662f JSP\uff0c\u9019\u4e9b\u6280\u8853\u90fd\u80fd\u70ba\u958b\u767c\u8005\u63d0\u4f9b\u9748\u6d3b\u7684\u89e3\u6c7a\u65b9\u6848\u3002\u5982\u679c\u4f60\u6b63\u5728\u5c0b\u627e\u7a69\u5b9a\u7684 <a href=\"https:\/\/server.hk\">\u9999\u6e2f VPS<\/a> \u670d\u52d9\u4f86\u652f\u6301\u4f60\u7684\u61c9\u7528\u7a0b\u5e8f\uff0cServer.HK \u63d0\u4f9b\u591a\u7a2e\u9078\u64c7\uff0c\u6eff\u8db3\u4e0d\u540c\u9700\u6c42\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b78\u7fd2\u5982\u4f55\u5728 Windows IIS \u4e0a\u914d\u7f6e JSP \u548c PHP \u74b0\u5883\uff0c\u7c21\u55ae\u6b65\u9a5f\u52a9\u4f60\u5feb\u901f\u642d\u5efa\u7db2\u9801\u61c9\u7528\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-49102","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/49102","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=49102"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/49102\/revisions"}],"predecessor-version":[{"id":49103,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/49102\/revisions\/49103"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=49102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=49102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=49102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}