{"id":54339,"date":"2024-10-09T18:35:14","date_gmt":"2024-10-09T10:35:14","guid":{"rendered":"https:\/\/server.hk\/cnblog\/54339\/"},"modified":"2024-10-09T18:35:15","modified_gmt":"2024-10-09T10:35:15","slug":"windows-%e4%b8%8b-homestead-%e9%96%8b%e7%99%bc%e7%92%b0%e5%a2%83%e5%ae%89%e8%a3%9d%e8%a9%b3%e7%b4%b0%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/54339\/","title":{"rendered":"Windows \u4e0b Homestead \u958b\u767c\u74b0\u5883\u5b89\u88dd\u8a73\u7d30\u6559\u7a0b"},"content":{"rendered":"<h1 id=\"windows-%e4%b8%8b-homestead-%e9%96%8b%e7%99%bc%e7%92%b0%e5%a2%83%e5%ae%89%e8%a3%9d%e8%a9%b3%e7%b4%b0%e6%95%99%e7%a8%8b-rToBjZYNhg\">Windows \u4e0b Homestead \u958b\u767c\u74b0\u5883\u5b89\u88dd\u8a73\u7d30\u6559\u7a0b<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u958b\u767c\u74b0\u5883\u4e2d\uff0cHomestead \u662f\u4e00\u500b\u975e\u5e38\u53d7\u6b61\u8fce\u7684\u9078\u64c7\uff0c\u7279\u5225\u662f\u5c0d\u65bc\u4f7f\u7528 Laravel \u6846\u67b6\u7684\u958b\u767c\u8005\u3002Homestead \u662f\u4e00\u500b\u5b98\u65b9\u7684 Vagrant \u958b\u767c\u74b0\u5883\uff0c\u63d0\u4f9b\u4e86\u4e00\u500b\u5b8c\u6574\u7684 PHP \u958b\u767c\u74b0\u5883\uff0c\u4e26\u4e14\u53ef\u4ee5\u5728\u591a\u500b\u5e73\u53f0\u4e0a\u904b\u884c\uff0c\u5305\u62ec Windows\u3002\u672c\u6587\u5c07\u8a73\u7d30\u4ecb\u7d39\u5982\u4f55\u5728 Windows \u7cfb\u7d71\u4e0a\u5b89\u88dd Homestead \u958b\u767c\u74b0\u5883\u3002<\/p>\n<h2 id=\"%e5%89%8d%e7%bd%ae%e6%a2%9d%e4%bb%b6-rToBjZYNhg\">\u524d\u7f6e\u689d\u4ef6<\/h2>\n<p>\u5728\u958b\u59cb\u5b89\u88dd\u4e4b\u524d\uff0c\u8acb\u78ba\u4fdd\u60a8\u7684\u7cfb\u7d71\u6eff\u8db3\u4ee5\u4e0b\u8981\u6c42\uff1a<\/p>\n<ul>\n<li>Windows 10 \u6216\u66f4\u9ad8\u7248\u672c<\/li>\n<li>\u5b89\u88dd\u4e86 VirtualBox<\/li>\n<li>\u5b89\u88dd\u4e86 Vagrant<\/li>\n<li>\u5b89\u88dd\u4e86 Git<\/li>\n<\/ul>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e4%b8%80%ef%bc%9a%e5%ae%89%e8%a3%9d-virtualbox-%e5%92%8c-vagrant-rToBjZYNhg\">\u6b65\u9a5f\u4e00\uff1a\u5b89\u88dd VirtualBox \u548c Vagrant<\/h2>\n<p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u5b89\u88dd VirtualBox \u548c Vagrant\u3002\u53ef\u4ee5\u5f9e\u4ee5\u4e0b\u93c8\u63a5\u4e0b\u8f09\uff1a<\/p>\n<ul>\n<li><a href=\"https:\/\/www.virtualbox.org\/\" rel=\"nofollow noopener\" target=\"_blank\">VirtualBox<\/a><\/li>\n<li><a href=\"https:\/\/www.vagrantup.com\/\" rel=\"nofollow noopener\" target=\"_blank\">Vagrant<\/a><\/li>\n<\/ul>\n<p>\u4e0b\u8f09\u5b8c\u6210\u5f8c\uff0c\u6309\u7167\u5b89\u88dd\u5411\u5c0e\u7684\u6307\u793a\u9032\u884c\u5b89\u88dd\u3002\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u53ef\u4ee5\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f38\u5165\u4ee5\u4e0b\u547d\u4ee4\u4f86\u6aa2\u67e5\u5b89\u88dd\u662f\u5426\u6210\u529f\uff1a<\/p>\n<pre><code>vagrant -v\n<\/code><\/pre>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e4%ba%8c%ef%bc%9a%e5%ae%89%e8%a3%9d-homestead-rToBjZYNhg\">\u6b65\u9a5f\u4e8c\uff1a\u5b89\u88dd Homestead<\/h2>\n<p>\u63a5\u4e0b\u4f86\uff0c\u60a8\u9700\u8981\u5b89\u88dd Homestead\u3002\u9996\u5148\uff0c\u6253\u958b\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u7136\u5f8c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f86\u5b89\u88dd Homestead\uff1a<\/p>\n<pre><code>vagrant box add laravel\/homestead\n<\/code><\/pre>\n<p>\u9019\u5c07\u4e0b\u8f09 Homestead \u7684 Vagrant box\uff0c\u9019\u53ef\u80fd\u9700\u8981\u4e00\u4e9b\u6642\u9593\uff0c\u5177\u9ad4\u53d6\u6c7a\u65bc\u60a8\u7684\u7db2\u7d61\u901f\u5ea6\u3002<\/p>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e4%b8%89%ef%bc%9a%e9%85%8d%e7%bd%ae-homestead-rToBjZYNhg\">\u6b65\u9a5f\u4e09\uff1a\u914d\u7f6e Homestead<\/h2>\n<p>\u4e0b\u8f09\u5b8c\u6210\u5f8c\uff0c\u60a8\u9700\u8981\u914d\u7f6e Homestead\u3002\u9996\u5148\uff0c\u5275\u5efa\u4e00\u500b\u65b0\u7684\u8cc7\u6599\u593e\u4f86\u5b58\u653e\u60a8\u7684 Homestead \u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n<pre><code>mkdir Homestead\ncd Homestead\n<\/code><\/pre>\n<p>\u7136\u5f8c\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f86\u521d\u59cb\u5316 Homestead\uff1a<\/p>\n<pre><code>vagrant init laravel\/homestead\n<\/code><\/pre>\n<p>\u9019\u5c07\u5275\u5efa\u4e00\u500b\u540d\u70ba <code>Vagrantfile<\/code> \u7684\u6587\u4ef6\uff0c\u60a8\u53ef\u4ee5\u5728\u5176\u4e2d\u9032\u884c\u914d\u7f6e\u3002\u6253\u958b <code>Vagrantfile<\/code>\uff0c\u4e26\u6839\u64da\u60a8\u7684\u9700\u6c42\u9032\u884c\u4fee\u6539\uff0c\u4f8b\u5982\u8a2d\u7f6e\u5171\u4eab\u6587\u4ef6\u593e\u548c\u7db2\u7d61\u914d\u7f6e\u3002<\/p>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e5%9b%9b%ef%bc%9a%e5%95%9f%e5%8b%95-homestead-rToBjZYNhg\">\u6b65\u9a5f\u56db\uff1a\u555f\u52d5 Homestead<\/h2>\n<p>\u914d\u7f6e\u5b8c\u6210\u5f8c\uff0c\u60a8\u53ef\u4ee5\u555f\u52d5 Homestead\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f86\u555f\u52d5\u865b\u64ec\u6a5f\uff1a<\/p>\n<pre><code>vagrant up\n<\/code><\/pre>\n<p>\u9019\u5c07\u555f\u52d5 Homestead \u865b\u64ec\u6a5f\uff0c\u4e26\u4e14\u6703\u81ea\u52d5\u914d\u7f6e\u6240\u9700\u7684\u74b0\u5883\u3002\u555f\u52d5\u904e\u7a0b\u4e2d\uff0c\u60a8\u53ef\u80fd\u6703\u770b\u5230\u4e00\u4e9b\u5b89\u88dd\u904e\u7a0b\u7684\u65e5\u8a8c\u4fe1\u606f\u3002<\/p>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e4%ba%94%ef%bc%9a%e8%a8%aa%e5%95%8f-homestead-rToBjZYNhg\">\u6b65\u9a5f\u4e94\uff1a\u8a2a\u554f Homestead<\/h2>\n<p>\u4e00\u65e6\u865b\u64ec\u6a5f\u555f\u52d5\u6210\u529f\uff0c\u60a8\u53ef\u4ee5\u901a\u904e\u700f\u89bd\u5668\u8a2a\u554f Homestead \u63d0\u4f9b\u7684\u670d\u52d9\u3002\u9ed8\u8a8d\u60c5\u6cc1\u4e0b\uff0c\u60a8\u53ef\u4ee5\u901a\u904e <code>http:\/\/homestead.test<\/code> \u8a2a\u554f\u60a8\u7684\u958b\u767c\u74b0\u5883\u3002\u8acb\u78ba\u4fdd\u5728\u60a8\u7684 <code>hosts<\/code> \u6587\u4ef6\u4e2d\u6dfb\u52a0\u76f8\u61c9\u7684\u689d\u76ee\uff0c\u4ee5\u4fbf\u80fd\u5920\u6b63\u78ba\u8a2a\u554f\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-rToBjZYNhg\">\u7e3d\u7d50<\/h2>\n<p>\u5728 Windows \u4e0b\u5b89\u88dd Homestead \u958b\u767c\u74b0\u5883\u7684\u904e\u7a0b\u76f8\u5c0d\u7c21\u55ae\uff0c\u53ea\u9700\u9075\u5faa\u4e0a\u8ff0\u6b65\u9a5f\u5373\u53ef\u5b8c\u6210\u3002Homestead \u63d0\u4f9b\u4e86\u4e00\u500b\u5f37\u5927\u7684\u958b\u767c\u74b0\u5883\uff0c\u9069\u5408 Laravel \u958b\u767c\u8005\u4f7f\u7528\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\u6e2f VPS<\/a> \u4f86\u9032\u884c\u90e8\u7f72\uff0c\u9019\u6a23\u53ef\u4ee5\u7372\u5f97\u66f4\u597d\u7684\u6027\u80fd\u548c\u7a69\u5b9a\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8a73\u7d30\u6559\u7a0b\u6559\u4f60\u5982\u4f55\u5728 Windows \u4e0b\u5b89\u88dd Homestead \u958b\u767c\u74b0\u5883\uff0c\u8f15\u9b06\u914d\u7f6e\u865b\u64ec\u6a5f\uff0c\u63d0\u5347\u958b\u767c\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-54339","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/54339","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=54339"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/54339\/revisions"}],"predecessor-version":[{"id":54340,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/54339\/revisions\/54340"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=54339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=54339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=54339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}