While running PHP bin/magento deploy:mode:set production I am getting error on magento 2.1

℡╲_俬逩灬. 提交于 2020-03-26 08:21:31

问题


I am using php7 with nginx

Something went wrong while compiling generated code. See the error log for details.

Command returned non-zero exit code: /usr/bin/php7.0 -f /var/www/magento2/bin/magento setup:di:compile


回答1:


try to run the failing command with the -vvv switch (for very verbose output).

/usr/bin/php7.0 -f /var/www/magento2/bin/magento setup:di:compile -vvv

with this command you should at least get a better error message than "an error occurred..."

very likely, it's just the memory_limit being too low. You can increase the memory limit for a php process by adding the -d parameter to the php command:

/usr/bin/php7.0 -d memory_limit=1G -f /var/www/magento2/bin/magento setup:di:compile

if you run deploy:mode:set production, the compilation will be startet as a sub process and you can't increase the memory limit like this (since the parameter is not passed to the sub command)

in this case, you have to increase the memory limit in your php configuration




回答2:


Command returned non-zero exit code: /usr/bin/php7.0 -f /var/www/magento2/bin/magento setup:di:compile

In Magento 2 world, this error message is widely-known as memory limit problem. That is why in Magento 2 requirement, they recommend us to set

memory_limit = 768M

That is the perfect size to run Magento 2 commands in almost situation.



来源:https://stackoverflow.com/questions/41394530/while-running-php-bin-magento-deploymodeset-production-i-am-getting-error-on-m

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!