1

Magento is searching for files into below location,(one for example)

localhost/magento2/pub/static/frontend/Magento/luma/it_CH/mage/calendar.css

but after I run setup:static-content:deploy in pub/static/frontend. I only have en_US. I have added no other languages so I don't know why magento is looking into it_CH returning 404.

3
  • Please, check the current language in STORES > Configuration? Commented Oct 18, 2016 at 0:35
  • Thank you. But i still don't understand the logic behind this, in backend everything works normally and look for files into en_US so i can run setup:static-content:deploy with no options. In frontend i need to specify my language? And if i have more than one language i need to run the command for every one? Commented Oct 18, 2016 at 0:53
  • Yes, you should read more: devdocs.magento.com/guides/v2.1/config-guide/cli/… Commented Oct 18, 2016 at 2:49

3 Answers 3

1

You have to run deploy command like below to prevent error from it_CH store,

For multi language store, you have to pass each language as space separated after deploy command

In your case it_CH language is enabled, so you have to run below command,

php bin/magento setup:static-content:deploy en_US it_CH

If have problem to deploy, add memory, It work for me with Plesk

php -dmemory_limit=6G bin/magento setup:static-content:deploy en_US it_CH
0

You have to execute deploy command with each language pack and provide permission to pub and var folder

Steps you need to follow-

  • move to var folder using command cd var

  • now remove old file using rm -rf *

  • now go to static folder present in pub directory and execute rm -rf *
  • Finally execute deploy

php bin/magento setup:static-content:deploy en_US it_CH

  • Now execute permission commands

    chmod -R 755 pub var

0

Anyone who has been struggling with this as I have here was the root I took to combat this error successfully.

  1. Ensure mod_rewrite is enable on your server
  2. Clear all caches
  3. Run the php bin/magento setup:static-content:deploy command
  4. then chmod -R 777 var/ pub/static/ generated/

IF these still fail (As they did me);

  1. Ensure the apache module mod_version is installed on the server.

Why? Because in the Pub folder there is a htaccess file that is using the IfVersion commands. You have to have mod_version installed for apache to understand this.

As soon as I enabled this, boom all started working as should.

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.