setup:di:在Magento 2中编译和更改模式到生产失败

时间:2017-04-19 06:16:48

标签: php magento magento2

当我尝试将模式从开发人员更改为生产时,将返回非零退出代码。我发现它不是在部署静态内容期间,而是在编译期间。 <input type="text" maxlength="10" onkeyup="if (/\D/g.test(this.value)) this.value = this.value.replace(/\D/g,'')" name="mobile" placeholder="Mobile Number"> 是2000M。我检查了memory_limit并发现它停止并退出php bin/magento setup:di:compile的编译而没有显示任何错误。我将站点迁移到localhost,现在它已成功编译并进入生产模式。

为什么它在localhost中工作,但在在线服务器上失败?

2 个答案:

答案 0 :(得分:1)

打开管理员:商店&gt;配置&gt;高级&gt;开发人员&gt;前端开发工作流程&gt; <工作流程类型>服务器端少编译然后

使用以下commonds设置生产模式。

rm -rf var/*
rm -rf pub/static/*
php bin/magento deploy:mode:set production --skip-compilation
php -dmemory_limit=6G bin/magento setup:static-content:deploy
chmod -R 7777 var pub/static

答案 1 :(得分:0)

在获取内存限制问题时,请使用此命令进行部署。

php -dmemory_limit = 6G bin / magento setup:static-content:deploy