2

I'm trying to put my Magento 2 installation into production mode, when I try it I get following error

Something went wrong while compiling generated code. See the error log for details.
Command returned non-zero exit code:
`/opt/alt/php56/usr/bin/php -f /home/magento2/public_html/bin/magento setup:di:compile`
#0 /home/magento2/public_html/vendor/magento/module-deploy/Model/Filesystem.php(245): Magento\Framework\App\Shell->execute('/opt/alt/php56/...')
#1 /home/magento2/public_html/vendor/magento/module-deploy/Model/Filesystem.php(143): Magento\Deploy\Model\Filesystem->compile(Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /home/magento2/public_html/vendor/magento/module-deploy/Model/Mode.php(83): Magento\Deploy\Model\Filesystem->regenerateStatic(Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /home/magento2/public_html/vendor/magento/module-deploy/Console/Command/SetModeCommand.php(100): Magento\Deploy\Model\Mode->enableProductionMode()
#4 /home/magento2/public_html/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(257): Magento\Deploy\Console\Command\SetModeCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 /home/magento2/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php(874): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /home/magento2/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php(195): Symfony\Component\Console\Application->doRunCommand(Object(Magento\Deploy\Console\Command\SetModeCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /home/magento2/public_html/vendor/magento/framework/Console/Cli.php(96): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /home/magento2/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php(126): Magento\Framework\Console\Cli->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /home/magento2/public_html/bin/magento(23): Symfony\Component\Console\Application->run()
#10 {main}

But I was able to run setup:di:compile successfully, this error occures only when run deploy:mode:set production

please help me to understand this issue and resolve it.

3

first, you can see file var/log/system.log if you found error Allowed memory size bla bla bla exhausted its mean you must change variable memory_limit in php.ini file, use larger value.

  • Yeah sometimes it loses connection with the redis server, so you can run redis-cli flushall – Stevie G Feb 3 '17 at 14:48
1

I had the same problem earlier with a clean M 2.1 install (no products /DB) + plus the Porto theme.

To eliminate that it was the porto theme that caused the problems I made a new / fresh install of Magento 2.1 without any theme.

Then compilation worked*

One might conclude that it Porto theme was the problem. But There are on other factor.

On my second install I set memory limit to 2G when running the Setup Wizard (offical recommendation).

On my first install (the one with compilation problems) the memory limit where set to 768M. This might have caused a problem so therefor I not 100% that I can blame the Porto theme even if it´s the most likely cause.

BR

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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