Showing results for 
Search instead for 
Did you mean: 

Can't enable production mode.


Can't enable production mode.

I have:
Magento 2.1.2 in developer mode

When I try to switch it to production mode "php bin/magento deploy:mode:set production" I got an error
"Command returned non-zero exit code:
`/usr/bin/php5 -f /data/magento_store/magento2/magento_store/bin/magento setup:static-content:deploy en_US zh_Hant_HK`"


When I try 'magento setup:static-content:deploy en_US zh_Hant_HK' it completed without errors.


I have rechecked permissions, It's OK.

I try this command under the "root" user. Same error.


PHP 5.6.27-0+deb8u1
Apache/2.4.10 (Debian)
mysqld 5.6.34


Please give me any clue what is wrong?


Re: Can't enable production mode.

One more thing


When enable to production failed. Any CLI command showed error


We're sorry, an error occurred. Try clearing the cache and code generation directories. By default, they are: var/cache, var/di, var/generation, and var/page_cache.

  Recoverable Error: Argument 1 passed to Migration\Console\MigrateSettingsCommand::__construct() must be an instance of Migration\Config, instance of Magento\Framework\ObjectManager\ObjectManag
  er given, called in /data/magento_ia/magento2/magento_ia/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93 and defined in /data/magento_ia/magento2/magento_ia/vendo
  r/magento/data-migration-tool/src/Migration/Console/MigrateSettingsCommand.php on line 25

 Remove files from "var/cache, var/di, var/generation, and var/page_cache" fixed this issue


Re: Can't enable production mode.

I have solved this issue by removing Migration Tools


composer remove magento/data-migration-tool --update-with-dependencies