magento2: Not able to deploy production mode correctly - Compilation Fails

Their seems to be a bug when setting the Magento 2 store from developer to production. I have tried the following command:

  php -f bin/magento deploy:mode:set production

Some people here have solved the problem to increase the memory_limit however I have checked the memory_limit and this is as high as 2GB.

$ php -i | grep memory

memory_limit => 2048M => 2048M
Collecting memory statistics => No
Shared memory model => mmap
Used memory => 14151928
Free memory => 3234336520
Wasted memory => 0
Interned Strings Used memory => 486776
Interned Strings Free memory => 7901832
opcache.memory_consumption => 3098 => 3098
opcache.preferred_memory_model => no value => no value
opcache.protect_memory => 0 => 0

Error:

Enabled maintenance mode
Static content deployment start Requested languages: nl_NL
=== frontend -> Magento/blank -> nl_NL ===
....more....
Successful: 2068 files; errors: 0

---

=== frontend -> Magento/luma -> nl_NL ===
....more....
Successful: 2141 files; errors: 0

---

=== frontend -> Bluebursttheme/theme-frontend-blueburst -> nl_NL ===
....more....
Successful: 2142 files; errors: 0

---

=== adminhtml -> Magento/backend -> nl_NL ===
....more....
Successful: 1922 files; errors: 0

---

=== Minify templates ===
....more....
Successful: 860 files modified

---

New version of deployed files: 1458553439
Static content deployment complete
Start compilation
Command returned non-zero exit code:
`php -f /home/telefoon/domains/blueburst.nl/public_html/bin/magento setup:di:compile-multi-tenant 2>&1`

Please let me know if you know a solution to solve this bug.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 22 (1 by maintainers)

Most upvoted comments

hi @adilbenmoussa ! they answered and the problem is solved for us.

temporarily workaround: php magento deploy:mode:set production --skip-compilation

their answer:

Hi romeo As Magento 2 cannot complete Porto compilaltion process at this time, so installation theme but skipping compilation is choosen. Could you pls ignore compilation at this time. We will update it in upcomming version.

guess that will help. have a great day, romeo

This problem was solved in last release of Porto theme.

try: php -d set_time_limit=3600 -d memory_limit=1024M bin/magento setup:di:compile-multi-tenant

@MichielTG , @romeof1980, At my site, we got this error while openning the categories management in admin.I renamed the file SubcatColumns.php to Subcatcolumns.php (do the same in the class name). This fix also require disabling the cache to get the categories page work. Still keep investigating!😃

Find the file: SubcatColumns.php Smartwave\Megamenu\Model\Attribute\SubcatColumns.php and add the line:

namespace Smartwave\Megamenu\Model\Attribute;

ok @marcb85 ! let’s stay in touch and post the updates here. have a great day, romeo

Update For people using Multisafepay. Add the following line to Issuers.php and Gateways.php

namespace MultiSafepay\Connect\Model\Api\Objects;