Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
264 views
in Technique[技术] by (71.8m points)

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

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...