4

I have a Magento 2 store which throws an error when entering production mode.

bin/magento deploy:mode:set production

Runs most the way until hitting deploy static content:

Something went wrong while deploying static content. See the error log for details.

Command returned non-zero exit code:
`/usr/bin/php7.0 -f /var/www/mage2/public_html/bin/magento setup:static-content:deploy -f en_GB en_US`

I can however run deploy static content without an error it seems.

In my logs i am getting a few errors for the theme with theme_dir not passed.

[InvalidArgumentException]
Required parameter 'theme_dir' was not passed

I am unsure why these are set to en_US however as would like them en_GB. I have all the themes set in the correct folders however i believe and am unsure how to resolve this error.

2

1 Answer 1

15

Change the mode and skip the compilation:

php bin/magento deploy:mode:set production --skip-compilation

And once the mode is switched you can deploy static content with GB locale.

php bin/magento setup:static-content:deploy en_GB

Magento default locale is en_US so you have to define your language.

If that fails, make sure your /var and pub/ have the correct permissions

It could be that your PHP is exhausted so increasing the limit in php.ini should help but skipping the compilation and compiling after switch is a good workaround.

Also, make sure your store in use has a valid theme selected, it might be that you are using a theme that doesn't exist in the system.

3
  • I have fixed this now a while ago cant remember what it was but just needed to tidy up the question. Will mark as a solution however thanks for your help!
    – harri
    Jan 26, 2018 at 12:14
  • Didn't realise how old this post was. It was bumped up by community :D Hope it will help someone else
    – Greg
    Jan 26, 2018 at 12:25
  • This was back when i first tried Magento 2 i think
    – harri
    Jan 26, 2018 at 12:26

Your Answer

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

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