{"id":183,"date":"2023-02-19T19:27:59","date_gmt":"2023-02-19T11:27:59","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=183"},"modified":"2023-02-19T19:28:22","modified_gmt":"2023-02-19T11:28:22","slug":"magento-mode-setting","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/19\/magento-mode-setting\/","title":{"rendered":"Magento\u6a21\u5f0f\u8bbe\u7f6e"},"content":{"rendered":"<p>Magento\u6709\u4e09\u79cd\u8fd0\u884c\u6a21\u5f0f\uff0c\u6309\u6027\u80fd\u7531\u4f4e\u5230\u9ad8\uff0c\u4f9d\u6b21\u4e3a\uff1a<code>developer<\/code> &lt; <code>default<\/code> &lt; <code>production<\/code><\/p>\n<p>\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u5f53\u524d\u8fd0\u884c\u6a21\u5f0f\uff1a<\/p>\n<pre><code class=\"language-bash\">bin\/magento deploy:mode:show<\/code><\/pre>\n<p><!-- more --><\/p>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8bbe\u7f6e\u8fd0\u884c\u6a21\u5f0f\uff1a<\/p>\n<pre><code class=\"language-bash\">bin\/magento deploy:mode:set developer  \nbin\/magento deploy:mode:set default   \nbin\/magento deploy:mode:set production<\/code><\/pre>\n<p>Magento\u9ed8\u8ba4\u4f7f\u7528\u7684\u8fd0\u884c\u6a21\u5f0f\u4e3a<code>default<\/code>\uff0c\u4e3a\u4e86\u66f4\u597d\u7684\u4f53\u9a8c\uff0c\u5efa\u8bae\u5207\u6362\u5230<code>production<\/code>\u6a21\u5f0f\u3002<br \/>\n\u5982\u679c\u4f60\u7684\u9879\u76ee\u91cc\u5305\u542b\u4e86\u5f88\u591a\u4e3b\u9898\uff0c\u8bbe\u7f6e\u7684\u8bed\u8a00\u5305\u4e5f\u6709\u591a\u4e2a\u7684\u8bdd\uff0c\u90a3\u4e48\u5728deploy\u7684\u65f6\u5019\uff0c\u53ef\u80fd\u4f1a\u5361\u5f88\u4e45\u3002\u90a3\u662f\u56e0\u4e3a\u5207\u6362\u5230\u751f\u4ea7\u6a21\u5f0f\u7684\u65f6\u5019\uff0c\u6bcf\u4e2a\u4e3b\u9898\u6bcf\u4e2a\u8bed\u8a00\u90fd\u8981\u751f\u6210\u4e00\u5957\u9759\u6001\u6587\u4ef6\uff0c\u7c97\u7565\u8ba4\u4e3a\u4e00\u5957\u9759\u6001\u6587\u4ef6\u9700\u898110\u79d2\uff0c\u5219\u603b\u5171\u9700\u8981\u7684\u65f6\u95f4\u4e3a<code>m*n*10<\/code>\u3002<\/p>\n<p>\u89e3\u51b3\u65b9\u6cd5\u6709\u4e24\u79cd\uff1a\u7b2c\u4e00\u79cd\u5220\u9664\u4e0d\u8981\u7684\u8bed\u8a00\u5305\uff1b\u7b2c\u4e8c\u79cd\u628a\u6ce8\u518c\u6587\u4ef6<code>registration.php<\/code>\u6539\u6210<code>registration.php.bak<\/code>\u3002<\/p>\n<p>\u751f\u4ea7\u6a21\u5f0f\u4e0b\uff0c\u5982\u679c\u4fee\u6539\u4e86\u4ee3\u7801\uff0c\u4e00\u822c\u9700\u8981\u4ee5\u4e0b\u51e0\u4e2a\u6b65\u9aa4\uff1a<\/p>\n<pre><code class=\"language-bash\"># \u542f\u7528\u7ef4\u62a4\u6a21\u5f0f\nmagento maintenance:enable\n# \u7f16\u8bd1\nbin\/magento setup:di:compile\n# \u90e8\u7f72\u9759\u6001\u6587\u4ef6\nbin\/magento setup:static-content:deploy\n# \u6e05\u7f13\u5b58\nbin\/magento cache:flush\n# \u505c\u7528\u7ef4\u62a4\u6a21\u5f0f\nmagento maintenance:disable<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Magento\u6709\u4e09\u79cd\u8fd0\u884c\u6a21\u5f0f\uff0c\u6309\u6027\u80fd\u7531\u4f4e\u5230\u9ad8\uff0c\u4f9d\u6b21\u4e3a\uff1adeveloper &lt; default &lt;  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[78],"tags":[77],"class_list":["post-183","post","type-post","status-publish","format-standard","hentry","category-magento","tag-magento"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=183"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/183\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}