When I run:sudo php bin/magento deploy:mode:set production

Then i received

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

marked as duplicate by Rakesh Jesadiya, Siarhey Uchukhlebau, Raphael at Digital Pianism magento2 Feb 21 '17 at 11:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • @Rakesh Jesadiya, I think the question is not duplicate. – abu abu Aug 19 '17 at 10:22

I resolved this issue

Run these commands:

1. sudo php bin/magento maintenance:disable
2. clear cache
3. sudo chmod 777 var* -R
4. sudo chmod 777 pub* -R

Not the answer you're looking for? Browse other questions tagged or ask your own question.