{"id":78,"date":"2017-03-21T16:29:45","date_gmt":"2017-03-21T08:29:45","guid":{"rendered":"https:\/\/www.unama.space\/?p=78"},"modified":"2020-04-18T02:03:02","modified_gmt":"2020-04-17T18:03:02","slug":"laravel-installation","status":"publish","type":"post","link":"https:\/\/unama.website\/?p=78","title":{"rendered":"Laravel installation"},"content":{"rendered":"<p>\u8acb\u5148\u78ba\u8a8d\u4f60\u5df2\u7d93\u5b89\u88dd\u4e86<a href=\"http:\/\/php.net\/\">PHP<\/a>(5.6\u4ee5\u4e0a\u7684\u7248\u672c)\u548c<a href=\"https:\/\/getcomposer.org\/\">Composer<\/a>(<a href=\"https:\/\/www.unama.space\/?p=70\">My Composer installation<\/a>)<\/p>\n<p>&nbsp;<\/p>\n<p>Step 1.&nbsp;\u4f7f\u7528 Composer \u4e0b\u8f09 Laravel installer\uff1a<\/p>\n<pre class=\"theme:dark-terminal lang:sh decode:true\">composer global require \"laravel\/installer\"<\/pre>\n<p>\u6ce8\u610f\u57f7\u884c\u5f8c\u7b2c\u4e00\u884c.composer\u7684\u4f4d\u7f6e\uff0c\u9810\u8a2d\u61c9\u8a72\u662f~\/.composer\uff0c\u5982\u679c\u6709\u8b8astep2\u8a18\u5f97\u8981\u6539\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>Step 2. \u5728.bashrc\u88e1\u52a0<\/p>\n<pre class=\"lang:vim decode:true\">export PATH=\"$HOME\/bin:\/usr\/local\/bin:~\/.composer\/vendor\/bin:$PATH\"<\/pre>\n<p>\u4e4b\u5f8c\u8a18\u5f97reload your config<\/p>\n<pre class=\"theme:dark-terminal lang:sh decode:true \">source .bashrc<\/pre>\n<p>\u9019\u6642laravel\u9019\u500b\u6307\u4ee4\u5c31\u53ef\u4ee5\u4f7f\u7528\u4e86<\/p>\n<p>&nbsp;<\/p>\n<p>Step 3. \u53ef\u4ee5\u958b\u59cb\u5efa\u7acblaravel project\u4e86<\/p>\n<pre class=\"theme:dark-terminal lang:sh decode:true\">laravel new blog<\/pre>\n<p>\u4e0d\u4e00\u5b9a\u8981\u53ebblog\uff0c\u4f60\u53ef\u4ee5\u53d6\u4f60\u559c\u6b61\u7684\u76ee\u9304\u540d\u7a31<\/p>\n<p>\u4e5f\u53ef\u4ee5\u5728\u6307\u4ee4\u5f8c\u52a0\u53c3\u6578&#8211;dev\uff0c\u4f7f\u7528dev\u7248\u672c<\/p>\n<p>&nbsp;<\/p>\n<p>Step 5. \u5982\u679c\u4f60\u7684\u7db2\u7ad9\u662f\u8981\u516c\u958b\u7684\uff0c\u8a18\u5f97\u8b93storage\u7684\u8cc7\u6599\u593e\u6709\u8b93others\u5beb\u5165\u7684\u6b0a\u9650<\/p>\n<pre class=\"theme:dark-terminal lang:sh decode:true \">sudo chmod -R o+w project_name\/storage<\/pre>\n<p>&nbsp;<\/p>\n<p>Step 4. \u9032\u5230blog\u5f8c\uff0c\u53ef\u4f7f\u7528php artisan serve\uff0c\u958b\u555fhttp:\/\/127.0.0.1:8000\uff0c\u5c31\u53ef\u4ee5\u770b\u5230laravel\u7684\u9996\u9801\u3002<\/p>\n<pre class=\"theme:dark-terminal lang:sh range:1-2 decode:true\">cd blog\nphp artisan serve<\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"size-medium wp-image-83 aligncenter\" src=\"https:\/\/www.unama.space\/wp-content\/uploads\/2017\/03\/\u87a2\u5e55\u5feb\u7167-2017-03-21-\u4e0b\u53484.28.14-300x175.png\" alt=\"\" width=\"300\" height=\"175\" srcset=\"https:\/\/unama.website\/wp-content\/uploads\/2017\/03\/\u87a2\u5e55\u5feb\u7167-2017-03-21-\u4e0b\u53484.28.14-300x175.png 300w, https:\/\/unama.website\/wp-content\/uploads\/2017\/03\/\u87a2\u5e55\u5feb\u7167-2017-03-21-\u4e0b\u53484.28.14-768x448.png 768w, https:\/\/unama.website\/wp-content\/uploads\/2017\/03\/\u87a2\u5e55\u5feb\u7167-2017-03-21-\u4e0b\u53484.28.14-1024x598.png 1024w, https:\/\/unama.website\/wp-content\/uploads\/2017\/03\/\u87a2\u5e55\u5feb\u7167-2017-03-21-\u4e0b\u53484.28.14-463x270.png 463w, https:\/\/unama.website\/wp-content\/uploads\/2017\/03\/\u87a2\u5e55\u5feb\u7167-2017-03-21-\u4e0b\u53484.28.14.png 1316w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8acb\u5148\u78ba\u8a8d\u4f60\u5df2\u7d93\u5b89\u88dd\u4e86PHP(5.6\u4ee5\u4e0a\u7684\u7248\u672c)\u548cComposer(My Composer installation) &nbsp; Step 1.&nbsp;\u4f7f&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/unama.website\/?p=78\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/unama.website\/index.php?rest_route=\/wp\/v2\/posts\/78"}],"collection":[{"href":"https:\/\/unama.website\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unama.website\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unama.website\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unama.website\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=78"}],"version-history":[{"count":9,"href":"https:\/\/unama.website\/index.php?rest_route=\/wp\/v2\/posts\/78\/revisions"}],"predecessor-version":[{"id":362,"href":"https:\/\/unama.website\/index.php?rest_route=\/wp\/v2\/posts\/78\/revisions\/362"}],"wp:attachment":[{"href":"https:\/\/unama.website\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=78"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unama.website\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=78"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unama.website\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=78"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}