I am trying to set Magento 2 website in production mode. However unable to set. It gives me below error.

Command returned non-zero exit code: /opt/plesk/php/7.0/bin/php -f /var/www/vhosts/sitename/httpdocs/bin/magento setup:static-content:deploy en_GB en_US

server's memory_limit is set to 2G. Magento version is 2.1.

Anybody could say what's wrong here while setting store in production mode?

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

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.

  • The command you're running is to the command the change the mode. It's the command that deploys the static content. Could you try bin/magento deploy:mode:set production ? – Raphael at Digital Pianism Sep 5 '16 at 7:59
  • Yes, i am using bin/magento deploy:mode:set production command to set in production mode. – Ravi Bhalodia Sep 5 '16 at 10:34

I resolved this issue by using these commands.

Run this 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.