I enabled vendor's list of modules & setup upgrade them. I changed deploying mode from developer to production. During that i encounter an error

sagar@sg2 public_html]$ php bin/magento deploy:mode:set production
Enabled maintenance mode
Starting compilation
Something went wrong while compiling generated code. See the error log for details.
Command returned non-zero exit code:

/opt/cpanel/ea-php56/root/usr/bin/php -f /home/ghema/public_html/bin/magento setup:di:compile

  • 1
    Did you check the error log ? What's in there ? Feb 8, 2017 at 10:47
  • On exception log : there was on error on template i had overriden to my theme. I commented it. On system.log there is an error saying Compilation was started. %message% 0/7 [>---------------------------] 0% 1 sec 72.0 MiB%message% 0/7 [>---------------------------] 0% 1 sec 72.0 MiBProxies code generation... 0/7 [>---------------------------] 0% 1 sec 72.0 MiB Proxies code generation... 1/7 [====>-----------------------] 14% 1 sec 77.5 MiB Repositories code generation... 1/7 [====>-----------------------] 14% 1 sec 77.5 MiB [] [] Feb 8, 2017 at 11:22

1 Answer 1


Since error is occurring during code generation it's likely to be an issue with either your custom theme or any addon modules/plugins.

If you run command php bin/magento setup:di:compile on it's own,code generation should break at the point of error and should throw a [ReflectionException] (or another error) that should point you in the right direction.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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