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?

  • 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 ? Commented Sep 5, 2016 at 7:59
  • Yes, i am using bin/magento deploy:mode:set production command to set in production mode. Commented Sep 5, 2016 at 10:34

1 Answer 1


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.