{"id":54261,"date":"2024-10-09T18:00:17","date_gmt":"2024-10-09T10:00:17","guid":{"rendered":"https:\/\/server.hk\/cnblog\/54261\/"},"modified":"2024-10-09T18:00:17","modified_gmt":"2024-10-09T10:00:17","slug":"windows-%e7%92%b0%e5%a2%83%e4%b8%8b%e5%a6%82%e4%bd%95%e9%85%8d%e7%bd%ae-wamp-%e7%9a%84%e8%99%9b%e6%93%ac%e5%9f%9f%e5%90%8d","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/54261\/","title":{"rendered":"Windows \u74b0\u5883\u4e0b\u5982\u4f55\u914d\u7f6e WAMP \u7684\u865b\u64ec\u57df\u540d"},"content":{"rendered":"<h1 id=\"windows-%e7%92%b0%e5%a2%83%e4%b8%8b%e5%a6%82%e4%bd%95%e9%85%8d%e7%bd%ae-wamp-%e7%9a%84%e8%99%9b%e6%93%ac%e5%9f%9f%e5%90%8d-JOdeUkqjTQ\">Windows \u74b0\u5883\u4e0b\u5982\u4f55\u914d\u7f6e WAMP \u7684\u865b\u64ec\u57df\u540d<\/h1>\n<p>\u5728\u958b\u767c\u548c\u6e2c\u8a66\u7db2\u7ad9\u6642\uff0c\u4f7f\u7528\u865b\u64ec\u57df\u540d\u53ef\u4ee5\u8b93\u958b\u767c\u8005\u66f4\u65b9\u4fbf\u5730\u7ba1\u7406\u591a\u500b\u9805\u76ee\u3002WAMP\uff08Windows, Apache, MySQL, PHP\uff09\u662f\u4e00\u500b\u6d41\u884c\u7684\u958b\u767c\u74b0\u5883\uff0c\u80fd\u5920\u5728 Windows \u7cfb\u7d71\u4e0a\u8f15\u9b06\u642d\u5efa\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u5728 Windows \u74b0\u5883\u4e0b\u914d\u7f6e WAMP \u7684\u865b\u64ec\u57df\u540d\uff0c\u5e6b\u52a9\u958b\u767c\u8005\u63d0\u9ad8\u5de5\u4f5c\u6548\u7387\u3002<\/p>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e4%b8%80%ef%bc%9a%e5%ae%89%e8%a3%9d-wamp-JOdeUkqjTQ\">\u6b65\u9a5f\u4e00\uff1a\u5b89\u88dd WAMP<\/h2>\n<p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u5728 Windows \u7cfb\u7d71\u4e0a\u5b89\u88dd WAMP\u3002\u53ef\u4ee5\u5f9e WAMP \u7684\u5b98\u65b9\u7db2\u7ad9\u4e0b\u8f09\u6700\u65b0\u7248\u672c\uff0c\u7136\u5f8c\u6309\u7167\u5b89\u88dd\u5411\u5c0e\u9032\u884c\u5b89\u88dd\u3002\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u555f\u52d5 WAMP \u4f3a\u670d\u5668\uff0c\u60a8\u6703\u770b\u5230\u7cfb\u7d71\u6258\u76e4\u4e2d\u7684 WAMP \u5716\u6a19\uff0c\u984f\u8272\u8b8a\u70ba\u7da0\u8272\u8868\u793a\u4f3a\u670d\u5668\u904b\u884c\u6b63\u5e38\u3002<\/p>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e4%ba%8c%ef%bc%9a%e5%89%b5%e5%bb%ba%e8%99%9b%e6%93%ac%e4%b8%bb%e6%a9%9f-JOdeUkqjTQ\">\u6b65\u9a5f\u4e8c\uff1a\u5275\u5efa\u865b\u64ec\u4e3b\u6a5f<\/h2>\n<p>\u63a5\u4e0b\u4f86\uff0c\u60a8\u9700\u8981\u5275\u5efa\u865b\u64ec\u4e3b\u6a5f\u3002\u865b\u64ec\u4e3b\u6a5f\u5141\u8a31\u60a8\u4f7f\u7528\u81ea\u5b9a\u7fa9\u57df\u540d\u4f86\u8a2a\u554f\u672c\u5730\u7db2\u7ad9\u3002\u4ee5\u4e0b\u662f\u5177\u9ad4\u6b65\u9a5f\uff1a<\/p>\n<h3 id=\"1-%e7%b7%a8%e8%bc%af-httpd-vhosts-conf-%e6%96%87%e4%bb%b6-JOdeUkqjTQ\">1. \u7de8\u8f2f httpd-vhosts.conf \u6587\u4ef6<\/h3>\n<p>\u6253\u958b WAMP \u7684\u5b89\u88dd\u76ee\u9304\uff0c\u901a\u5e38\u4f4d\u65bc <code>C:wampbinapacheapache2.x.xconfextrahttpd-vhosts.conf<\/code>\u3002\u5728\u6587\u4ef6\u672b\u5c3e\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u78bc\uff1a<\/p>\n<pre><code>&lt;VirtualHost *:80&gt;\n    DocumentRoot \"C:\/wamp\/www\/your_project_folder\"\n    ServerName yourdomain.local\n    &lt;\/VirtualHost&gt;<\/code><\/pre>\n<p>\u8acb\u5c07 <code>your_project_folder<\/code> \u66ff\u63db\u70ba\u60a8\u7684\u9805\u76ee\u6587\u4ef6\u593e\u540d\u7a31\uff0c<code>yourdomain.local<\/code> \u66ff\u63db\u70ba\u60a8\u5e0c\u671b\u4f7f\u7528\u7684\u865b\u64ec\u57df\u540d\u3002<\/p>\n<h3 id=\"2-%e7%b7%a8%e8%bc%af-hosts-%e6%96%87%e4%bb%b6-JOdeUkqjTQ\">2. \u7de8\u8f2f hosts \u6587\u4ef6<\/h3>\n<p>\u63a5\u4e0b\u4f86\uff0c\u60a8\u9700\u8981\u5c07\u865b\u64ec\u57df\u540d\u6620\u5c04\u5230\u672c\u5730 IP \u5730\u5740\u3002\u6253\u958b <code>C:WindowsSystem32driversetchosts<\/code> \u6587\u4ef6\uff0c\u4e26\u6dfb\u52a0\u4ee5\u4e0b\u884c\uff1a<\/p>\n<pre><code>127.0.0.1 yourdomain.local<\/code><\/pre>\n<p>\u9019\u6a23\uff0c\u7576\u60a8\u5728\u700f\u89bd\u5668\u4e2d\u8f38\u5165 <code>http:\/\/yourdomain.local<\/code> \u6642\uff0c\u7cfb\u7d71\u6703\u5c07\u8acb\u6c42\u5c0e\u5411\u672c\u5730\u4f3a\u670d\u5668\u3002<\/p>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e4%b8%89%ef%bc%9a%e9%87%8d%e5%95%9f-wamp-%e4%bc%ba%e6%9c%8d%e5%99%a8-JOdeUkqjTQ\">\u6b65\u9a5f\u4e09\uff1a\u91cd\u555f WAMP \u4f3a\u670d\u5668<\/h2>\n<p>\u5b8c\u6210\u4e0a\u8ff0\u914d\u7f6e\u5f8c\uff0c\u60a8\u9700\u8981\u91cd\u555f WAMP \u4f3a\u670d\u5668\u4ee5\u4f7f\u66f4\u6539\u751f\u6548\u3002\u53f3\u9375\u55ae\u64ca\u7cfb\u7d71\u6258\u76e4\u4e2d\u7684 WAMP \u5716\u6a19\uff0c\u9078\u64c7\u201c\u91cd\u555f\u6240\u6709\u670d\u52d9\u201d\u3002<\/p>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e5%9b%9b%ef%bc%9a%e6%b8%ac%e8%a9%a6%e8%99%9b%e6%93%ac%e5%9f%9f%e5%90%8d-JOdeUkqjTQ\">\u6b65\u9a5f\u56db\uff1a\u6e2c\u8a66\u865b\u64ec\u57df\u540d<\/h2>\n<p>\u5728\u700f\u89bd\u5668\u4e2d\u8f38\u5165 <code>http:\/\/yourdomain.local<\/code>\uff0c\u5982\u679c\u4e00\u5207\u914d\u7f6e\u6b63\u78ba\uff0c\u60a8\u61c9\u8a72\u80fd\u5920\u770b\u5230\u60a8\u7684\u9805\u76ee\u9801\u9762\u3002\u5982\u679c\u51fa\u73fe\u932f\u8aa4\uff0c\u8acb\u6aa2\u67e5 <code>httpd-vhosts.conf<\/code> \u548c <code>hosts<\/code> \u6587\u4ef6\u4e2d\u7684\u914d\u7f6e\u662f\u5426\u6b63\u78ba\u3002<\/p>\n<h2 id=\"%e5%b8%b8%e8%a6%8b%e5%95%8f%e9%a1%8c-JOdeUkqjTQ\">\u5e38\u898b\u554f\u984c<\/h2>\n<ul>\n<li><strong>\u70ba\u4ec0\u9ebc\u6211\u7684\u865b\u64ec\u57df\u540d\u7121\u6cd5\u8a2a\u554f\uff1f<\/strong> \u78ba\u4fdd WAMP \u4f3a\u670d\u5668\u6b63\u5728\u904b\u884c\uff0c\u4e26\u6aa2\u67e5 <code>hosts<\/code> \u6587\u4ef6\u548c <code>httpd-vhosts.conf<\/code> \u7684\u914d\u7f6e\u3002<\/li>\n<li><strong>\u6211\u53ef\u4ee5\u4f7f\u7528\u5176\u4ed6\u57df\u540d\u55ce\uff1f<\/strong> \u662f\u7684\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4efb\u4f55\u81ea\u5b9a\u7fa9\u57df\u540d\uff0c\u53ea\u9700\u78ba\u4fdd\u5728 <code>hosts<\/code> \u6587\u4ef6\u4e2d\u9032\u884c\u76f8\u61c9\u7684\u6620\u5c04\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b8%bd%e7%b5%90-JOdeUkqjTQ\">\u7e3d\u7d50<\/h2>\n<p>\u914d\u7f6e WAMP \u7684\u865b\u64ec\u57df\u540d\u662f\u4e00\u500b\u7c21\u55ae\u800c\u6709\u6548\u7684\u65b9\u5f0f\uff0c\u53ef\u4ee5\u5e6b\u52a9\u958b\u767c\u8005\u5728\u672c\u5730\u74b0\u5883\u4e2d\u9032\u884c\u591a\u500b\u9805\u76ee\u7684\u7ba1\u7406\u3002\u901a\u904e\u4e0a\u8ff0\u6b65\u9a5f\uff0c\u60a8\u53ef\u4ee5\u8f15\u9b06\u8a2d\u7f6e\u865b\u64ec\u4e3b\u6a5f\uff0c\u4e26\u4f7f\u7528\u81ea\u5b9a\u7fa9\u57df\u540d\u9032\u884c\u8a2a\u554f\u3002\u5982\u679c\u60a8\u9700\u8981\u66f4\u9ad8\u6548\u7684\u958b\u767c\u74b0\u5883\uff0c\u8003\u616e\u4f7f\u7528 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u4f86\u63d0\u5347\u60a8\u7684\u7db2\u7ad9\u6027\u80fd\u548c\u7a69\u5b9a\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b78\u7fd2\u5982\u4f55\u5728 Windows \u74b0\u5883\u4e0b\u914d\u7f6e WAMP \u7684\u865b\u64ec\u57df\u540d\uff0c\u7c21\u5316\u672c\u5730\u958b\u767c\u6d41\u7a0b\uff0c\u63d0\u5347\u7db2\u7ad9\u6e2c\u8a66\u6548\u7387\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-54261","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/54261","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=54261"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/54261\/revisions"}],"predecessor-version":[{"id":54262,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/54261\/revisions\/54262"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=54261"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=54261"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=54261"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}