Issue when switching to Production mode in Magento 2

When trying to switch from Developer mode to Production mode:-
php bin/magento deploy:mode:set production

You may see this error:-
Command returned non-zero exit code:

The error is most likely related to the PHP memory_limit

Make sure you set it to at least 768M and it should work. 

If it still doesn't work for you, you can always skip Compilation and do it later:-
php bin/magento deploy:mode:set production --skip-compilation



  • 11 Users Found This Useful
Was this answer helpful?

Related Articles

What PHP version to use for Magento 2?

The best PHP version to use for Magento 2 (for now) is PHP 5.6. If you are using our Web Hosting...

Broken Images / CSS or "Forbidden: PHP engine is disable" in Magento 2.0

If you see the error "Forbidden: PHP engine is disable." or a page without images or CSS after...

How to change the Admin Path for Magento 2.0?

To change the Admin Path for Magento, please open up the file below:- /app/etc/env.php Look for...

How to change the Database for Magento 2.0?

To change the Admin Path for Magento, please open up the file below:- /app/etc/env.php Look for...

How do I set the correct file permissions for Magento?

Magento installation out of the box does not use the correct and safe file permissions for our...