{"id":181,"date":"2020-04-05T00:52:58","date_gmt":"2020-04-04T16:52:58","guid":{"rendered":"https:\/\/blog.scxs.vip\/?p=181"},"modified":"2020-04-05T14:33:06","modified_gmt":"2020-04-05T06:33:06","slug":"webstack-laravel%e5%92%8c%e5%ae%9d%e5%a1%94%e5%ae%89%e8%a3%85%e6%ad%a5%e9%aa%a4","status":"publish","type":"post","link":"https:\/\/blog.scxs.vip\/?p=181","title":{"rendered":"WebStack-Laravel\u548c\u5b9d\u5854\u5b89\u88c5\u6b65\u9aa4"},"content":{"rendered":"\n<p class=\"is-style-text-indent-default wp-block-paragraph\">&nbsp;<\/p>\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-pandastudio-title\"><div class=\"title_style_01\"><h2 id=\"h2-0\">1\uff0c\u9879\u76ee\u4ecb\u7ecd<\/h2><\/div><\/div>\n\n\n<p><\/p>\n\n\n<p class=\"has-background has-very-light-gray-background-color is-style-text-indent-default wp-block-paragraph\">WebStack-Laravel\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u7f51\u5740\u5bfc\u822a\u7f51\u7ad9\u9879\u76ee\uff0c\u5177\u5907\u5b8c\u6574\u7684\u524d\u540e\u53f0\uff0c\u60a8\u53ef\u4ee5\u62ff\u6765\u5236\u4f5c\u81ea\u5df1\u7684\u7f51\u5740\u5bfc\u822a\u3002\u975e\u5e38\u7684\u7b80\u5355\u548c\u5b9e\u7528\u3002\u57fa\u672c\u4e0a\u6bcf\u4e2a\u5de5\u7a0b\u9879\u76ee\u4e0b\u6765\uff0c\u90fd\u4f1a\u914d\u5408\u5b9d\u5854+WebStack-Laravel\u7ed9\u7528\u6237\u642d\u5efa\u4e00\u5957\u8fd9\u4e2a\u5f00\u6e90\u9879\u76ee\u3002\u9274\u4e8e\u7f51\u4e0a\u90fd\u662f\u4f7f\u7528LNMP\u5b89\u88c5\uff0c\u6211\u5728\u8fd9\u91cc\u8be6\u7ec6\u5199\u4e00\u4e0b\u4f7f\u7528\u5b9d\u5854\u5b89\u88c5WebStack-Laravel\uff0c\u4ee5\u53ca\u51e0\u4e2a\u6ce8\u610f\u4e8b\u9879\u3002<\/p>\n\n\n<p><\/p>\n\n\n<p class=\"has-background has-very-light-gray-background-color is-style-text-indent-default wp-block-paragraph\">WebStack-Laravel github\u5730\u5740\uff1a<a href=\"https:\/\/github.com\/hui-ho\/WebStack-Laravel\">https:\/\/github.com\/hui-ho\/WebStack-Laravel<\/a><\/p>\n\n\n<p><\/p>\n\n\n<p class=\"has-background has-very-light-gray-background-color is-style-text-indent-default wp-block-paragraph\">WebStack-Laravel\u56fe\u9274\u5982\u4e0b\uff1a<\/p>\n\n\n<p><\/p>\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-194\" src=\"https:\/\/i0.wp.com\/blog.scxs.vip\/wp-content\/uploads\/2020\/04\/01-1.png?resize=1600%2C900&#038;ssl=1\" alt=\"\u9996\u9875\" width=\"1600\" height=\"900\" srcset=\"https:\/\/i0.wp.com\/blog.scxs.vip\/wp-content\/uploads\/2020\/04\/01-1.png?w=1600&amp;ssl=1 1600w, https:\/\/i0.wp.com\/blog.scxs.vip\/wp-content\/uploads\/2020\/04\/01-1.png?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/blog.scxs.vip\/wp-content\/uploads\/2020\/04\/01-1.png?resize=1024%2C576&amp;ssl=1 1024w, https:\/\/i0.wp.com\/blog.scxs.vip\/wp-content\/uploads\/2020\/04\/01-1.png?resize=768%2C432&amp;ssl=1 768w, https:\/\/i0.wp.com\/blog.scxs.vip\/wp-content\/uploads\/2020\/04\/01-1.png?resize=1536%2C864&amp;ssl=1 1536w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n<p><\/p>\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\">&nbsp;<\/p>\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-pandastudio-title\"><div class=\"title_style_01\"><h2 id=\"h2-1\">2\uff0c\u8be6\u7ec6\u5b89\u88c5\u6b65\u9aa4<\/h2><\/div><\/div>\n\n\n<p><\/p>\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\">&nbsp;<\/p>\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-pandastudio-title\"><div class=\"title_style_02\"><h3 id=\"h3-2\">2.1 \u5b9d\u5854\u5b89\u88c5<\/h3><\/div><\/div>\n\n\n<p><\/p>\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\">&nbsp;<\/p>\n\n\n<p><\/p>\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\">\u6211\u7528\u7684centos7.4\uff0c\u5176\u4ed6linux\u7248\u672c\u6216\u8005windows\u8bf7\u5230\u5b9d\u5854\u5b98\u7f51\uff0c\u4f7f\u7528\u5176\u4ed6\u547d\u4ee4\u3002\u5b9d\u5854\u5b98\u7f51\u5730\u5740\uff1a<a href=\"https:\/\/www.bt.cn\/\">https:\/\/www.bt.cn\/<\/a><\/p>\n\n\n<p><\/p>\n\n\n<pre class=\"wp-block-code\"><code>yum install -y wget &amp;&amp; wget -O install.sh http:\/\/download.bt.cn\/install\/install_6.0.sh &amp;&amp; sh install.sh<\/code><\/pre>\n\n\n<p><\/p>\n\n\n<p style=\"color:#ee1616\" class=\"has-text-color is-style-text-indent-default wp-block-paragraph\">\u5b8c\u6bd5\u540e\uff0c\u8fdb\u53bb\u5b9d\u5854\u540e\u53f0\u7ba1\u7406\u754c\u9762\uff0c\u7f16\u8bd1\u5b89\u88c5php7.4 + mysql5.7<\/p>\n\n\n<p><\/p>\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\">&nbsp;<\/p>\n\n\n<p><\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1042\" height=\"594\" src=\"https:\/\/i0.wp.com\/blog.scxs.vip\/wp-content\/uploads\/2020\/04\/FireShot-Capture-001-\u5b9d\u5854Linux\u9762\u677f-10.0.1.8.png?fit=1024%2C584&amp;ssl=1\" alt=\"\" class=\"wp-image-189\" srcset=\"https:\/\/i0.wp.com\/blog.scxs.vip\/wp-content\/uploads\/2020\/04\/FireShot-Capture-001-\u5b9d\u5854Linux\u9762\u677f-10.0.1.8.png?w=1042&amp;ssl=1 1042w, https:\/\/i0.wp.com\/blog.scxs.vip\/wp-content\/uploads\/2020\/04\/FireShot-Capture-001-\u5b9d\u5854Linux\u9762\u677f-10.0.1.8.png?resize=300%2C171&amp;ssl=1 300w, https:\/\/i0.wp.com\/blog.scxs.vip\/wp-content\/uploads\/2020\/04\/FireShot-Capture-001-\u5b9d\u5854Linux\u9762\u677f-10.0.1.8.png?resize=1024%2C584&amp;ssl=1 1024w, https:\/\/i0.wp.com\/blog.scxs.vip\/wp-content\/uploads\/2020\/04\/FireShot-Capture-001-\u5b9d\u5854Linux\u9762\u677f-10.0.1.8.png?resize=768%2C438&amp;ssl=1 768w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n<p><\/p>\n\n\n<p style=\"color:#ee1616\" class=\"has-text-color is-style-text-indent-default wp-block-paragraph\">\u7f16\u8bd1\u5b8c\u6210\u540e\uff0c\u8fdb\u5165php\u8bbe\u7f6e\uff0c\u5b89\u88c5 fileinfo \u6269\u5c55\uff0c\u5728\u7981\u7528\u51fd\u6570\u91cc\u5220\u9664putenv\uff0cproc_open\u3002<\/p>\n\n\n<p><\/p>\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\">&nbsp;<\/p>\n\n\n<p><\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"642\" height=\"598\" src=\"https:\/\/i0.wp.com\/blog.scxs.vip\/wp-content\/uploads\/2020\/04\/Snipaste_2020-04-05_00-33-03.png?resize=642%2C598&#038;ssl=1\" alt=\"\" class=\"wp-image-190\" srcset=\"https:\/\/i0.wp.com\/blog.scxs.vip\/wp-content\/uploads\/2020\/04\/Snipaste_2020-04-05_00-33-03.png?w=642&amp;ssl=1 642w, https:\/\/i0.wp.com\/blog.scxs.vip\/wp-content\/uploads\/2020\/04\/Snipaste_2020-04-05_00-33-03.png?resize=300%2C279&amp;ssl=1 300w\" sizes=\"auto, (max-width: 642px) 100vw, 642px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n<p><\/p>\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\">\u7136\u540e\u5f00\u59cb\u6b63\u5e38\u6dfb\u52a0\u7f51\u7ad9\u3002<\/p>\n\n\n<p><\/p>\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\">&nbsp;<\/p>\n\n\n<p><\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"646\" height=\"570\" src=\"https:\/\/i0.wp.com\/blog.scxs.vip\/wp-content\/uploads\/2020\/04\/Snipaste_2020-04-05_00-39-35.png?resize=646%2C570&#038;ssl=1\" alt=\"\" class=\"wp-image-191\" srcset=\"https:\/\/i0.wp.com\/blog.scxs.vip\/wp-content\/uploads\/2020\/04\/Snipaste_2020-04-05_00-39-35.png?w=646&amp;ssl=1 646w, https:\/\/i0.wp.com\/blog.scxs.vip\/wp-content\/uploads\/2020\/04\/Snipaste_2020-04-05_00-39-35.png?resize=300%2C265&amp;ssl=1 300w\" sizes=\"auto, (max-width: 646px) 100vw, 646px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-pandastudio-title\"><div class=\"title_style_02\"><h3 id=\"h3-3\">2.2 composer\u5b89\u88c5<\/h3><\/div><\/div>\n\n\n<p><\/p>\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\">&nbsp;<\/p>\n\n\n<p><\/p>\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\">SSH\u8fde\u63a5\u5230\u670d\u52a1\u5668\uff0c\u6267\u884c\u4e0b\u9762\u547d\u4ee4<\/p>\n\n\n<p><\/p>\n\n\n<pre class=\"wp-block-code\"><code>php -r \"copy('https:\/\/install.phpcomposer.com\/installer', 'composer-setup.php');\"\nphp composer-setup.php\nphp -r \"unlink('composer-setup.php');\"\nmv composer.phar  \/usr\/local\/bin\/composer\ncomposer config -g repo.packagist composer https:\/\/packagist.phpcomposer.com\ncomposer selfupdate\ncomposer update\n<\/code><\/pre>\n\n\n<p><\/p>\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\">&nbsp;<\/p>\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-pandastudio-title\"><div class=\"title_style_02\"><h3 id=\"h3-4\">2.3 \u5b89\u88c5WebStack-Laravel<\/h3><\/div><\/div>\n\n\n<p><\/p>\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\">\u514b\u9686\u4ee3\u7801\uff1a<\/p>\n\n\n<p><\/p>\n\n\n<pre class=\"wp-block-code\"><code>git clone https:\/\/github.com\/hui-ho\/WebStack-Laravel.git<\/code><\/pre>\n\n\n<p><\/p>\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\">\u5b89\u88c5\u4f9d\u8d56\uff1a<\/p>\n\n\n<p><\/p>\n\n\n<pre class=\"wp-block-code\"><code>composer install<\/code><\/pre>\n\n\n<p><\/p>\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\">\u7f16\u8f91\u914d\u7f6e\uff1a<\/p>\n\n\n<p><\/p>\n\n\n<pre class=\"wp-block-code\"><code>cp .env.example .env\n...\nDB_DATABASE=database\nDB_USERNAME=username\nDB_PASSWORD=password\n...<\/code><\/pre>\n\n\n<p><\/p>\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\">\u751f\u6210 KEY\uff1a<\/p>\n\n\n<p><\/p>\n\n\n<pre class=\"wp-block-code\"><code>php artisan key:generate  <\/code><\/pre>\n\n\n<p><\/p>\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\">\u8fc1\u79fb\u6570\u636e\uff1a<\/p>\n\n\n<p><\/p>\n\n\n<pre class=\"wp-block-code\"><code>php artisan migrate:refresh --seed<\/code><\/pre>\n\n\n<p><\/p>\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\">\u6570\u636e\u6e05\u9664\u547d\u4ee4\uff1a<\/p>\n\n\n<p><\/p>\n\n\n<pre class=\"wp-block-code\"><code>php artisan webstack:clean<\/code><\/pre>\n\n\n<p><\/p>\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\">\u540e\u53f0\u5730\u5740\uff1a<a href=\"http:\/\/domain\/admin\">http:\/\/domain\/admin<\/a><\/p>\n\n\n<p><\/p>\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\">\u9ed8\u8ba4\u7528\u6237\uff1aadmin<\/p>\n\n\n<p><\/p>\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\">\u9ed8\u8ba4\u5bc6\u7801\uff1aadmin<\/p>\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-pandastudio-title\"><div class=\"title_style_02\"><h3 id=\"h3-5\">2.4 \u540e\u7eed\u76f8\u5173\u8bbe\u7f6e<\/h3><\/div><\/div>\n\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\">\u8fd0\u884c\u76ee\u5f55\uff0c\u8bbe\u7f6e\u5230 public<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"679\" height=\"675\" src=\"https:\/\/i0.wp.com\/blog.scxs.vip\/wp-content\/uploads\/2020\/04\/Snipaste_2020-04-05_14-31-29.png?resize=679%2C675&#038;ssl=1\" alt=\"\" class=\"wp-image-202\" srcset=\"https:\/\/i0.wp.com\/blog.scxs.vip\/wp-content\/uploads\/2020\/04\/Snipaste_2020-04-05_14-31-29.png?w=679&amp;ssl=1 679w, https:\/\/i0.wp.com\/blog.scxs.vip\/wp-content\/uploads\/2020\/04\/Snipaste_2020-04-05_14-31-29.png?resize=300%2C298&amp;ssl=1 300w, https:\/\/i0.wp.com\/blog.scxs.vip\/wp-content\/uploads\/2020\/04\/Snipaste_2020-04-05_14-31-29.png?resize=150%2C150&amp;ssl=1 150w\" sizes=\"auto, (max-width: 679px) 100vw, 679px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\">\u4f2a\u9759\u6001\u8bbe\u7f6e\u4e3a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>location \/ {  \n\ttry_files $uri $uri\/ \/index.php$is_args$query_string;  \n}  <\/code><\/pre>\n\n\n\n<div class=\"wp-block-pandastudio-title\"><div class=\"title_style_01\"><h2 id=\"h2-6\">3\uff0c\u5e38\u89c1\u95ee\u9898\u6c47\u603b<\/h2><\/div><\/div>\n\n\n\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\">&nbsp;<\/p>\n\n\n\n<div class=\"wp-block-pandastudio-title\"><div class=\"title_style_02\"><h3 id=\"h3-7\">3.1 \u8fd0\u884c\u73af\u5883\u95ee\u9898<\/h3><\/div><\/div>\n\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\">\u4e00\u5b9a\u8981\u7528php7.0\u4ee5\u4e0a+MYSQL5.7\uff0cmysql5.6\u5bfc\u5165\u6570\u636e\u7684\u65f6\u5019\u4f1a\u62a5\u9519\u3002\u9700\u8981\u4fee\u6539\u4e00\u4e9b\u914d\u7f6e\uff0c\u6240\u4ee5\u5efa\u8bae\u76f4\u63a5\u4e0amysql5.7<\/p>\n\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\"><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nIn Connection.php line 664:\n\n  SQLSTATE&#91;42S01]: Base table or view already exists: 1050 Table 'admin_config' alre\n  ady exists (SQL: create table `admin_config` (`id` int unsigned not null auto_incr\n  ement primary key, `name` varchar(255) not null, `value` varchar(255) not null, `d\n  escription` text null, `created_at` timestamp null, `updated_at` timestamp null) d\n  efault character set utf8mb4 collate utf8mb4_unicode_ci)\n\n\nIn PDOStatement.php line 119:\n\n  SQLSTATE&#91;42S01]: Base table or view already exists: 1050 Table 'admin_config' alre\n  ady exists\n\n\nIn PDOStatement.php line 117:\n\n  SQLSTATE&#91;42S01]: Base table or view already exists: 1050 Table 'admin_config' alre\n  ady exists\n\n<\/code><\/pre>\n\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\"><\/p>\n\n\n\n<div class=\"wp-block-pandastudio-title\"><div class=\"title_style_02\"><h3 id=\"h3-8\">5.2 PHP\u6269\u5c55\u548c\u51fd\u6570\u7684\u95ee\u9898<\/h3><\/div><\/div>\n\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\">\u5b89\u88c5fileinfo\u6269\u5c55\u540e\uff0c\u89e3\u51b3\u4e0b\u9762\u62a5\u9519<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    The Process class relies on proc_open, which is not available on your PHP installation.\n    The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)\n    Unzip with unzip command failed, falling back to ZipArchive class\n<\/code><\/pre>\n\n\n\n<p class=\"is-style-text-indent-default wp-block-paragraph\">\u542f\u52a8putenv\u51fd\u6570\u548cproc_open\u51fd\u6570<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; WebStack-Laravel\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u7f51\u5740\u5bfc\u822a\u7f51\u7ad9\u9879\u76ee\uff0c\u5177\u5907\u5b8c\u6574\u7684\u524d\u540e\u53f0\uff0c\u60a8\u53ef\u4ee5\u62ff\u6765\u5236\u4f5c\u81ea [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":182,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[21,22],"class_list":["post-181","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-6","tag-web","tag-22"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/blog.scxs.vip\/wp-content\/uploads\/2020\/04\/\u56fe\u602a\u517d_64da7c13c6e8493300a5fb56723d7182_94353.png?fit=400%2C400&ssl=1","_links":{"self":[{"href":"https:\/\/blog.scxs.vip\/index.php?rest_route=\/wp\/v2\/posts\/181","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.scxs.vip\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.scxs.vip\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.scxs.vip\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.scxs.vip\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=181"}],"version-history":[{"count":14,"href":"https:\/\/blog.scxs.vip\/index.php?rest_route=\/wp\/v2\/posts\/181\/revisions"}],"predecessor-version":[{"id":204,"href":"https:\/\/blog.scxs.vip\/index.php?rest_route=\/wp\/v2\/posts\/181\/revisions\/204"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.scxs.vip\/index.php?rest_route=\/wp\/v2\/media\/182"}],"wp:attachment":[{"href":"https:\/\/blog.scxs.vip\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.scxs.vip\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.scxs.vip\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}