1

This question already has an answer here:

I have Magento 2.1.9 installed on my cPanel shared hosting account. Everything worked fine until I asked my hosting provider to run the necessary commands during Tawk.to chat integration. The commands he ran made my site to display blank pages.

I managed to get the site back online by running the following commands:

php bin/magento setup:upgrade php bin/magento

php setup:static-content:deploy

bin/magento cache:flush

chmod -R 777 var pub

Even though I can now access my site, but the CSS formatting and JavaScript in both the admin panel and frontend don't work. See how my admin panel looks like: enter image description here

Please note: in line 607 of the app/etc/di.xml file, I had already changed the following content:

Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink

to:

Magento\Framework\App\View\Asset\MaterializationStrategy\Copy

What else can I do to fix this issue?

Be advised that I set the file permissions for the directories below to 777.

/pub/

/pub/static/

The following directories have 775 permissions:

/pub/static/frontend/

/pub/static/adminhtml/

/pub/static/_requirejs/

What are the proper file permissions those directories? 755 or 777?

Please, I'd really appreciate your time and insight in helping me to resolve this issue. Thanks.

marked as duplicate by Ben Crook, Piyush, Siarhey Uchukhlebau, Manoj Deswal, Prince Patel Nov 15 '17 at 16:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

The reason of js and css not loading is most probably due to the improper static content deploy. Please try deploying your individual locale wise.

For eg:

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

Run

php bin/magento setup:upgrade

before running static content deploy just to make sure your previous content gets removed.

Hope this will help. If it does, don't forget to accept my answer and vote up.

Regards

  • Thanks for your insight. Sure, I won't forget to give you credit, if it works out. How do I ascertain the locale of the site? – Justin Nov 15 '17 at 12:43
  • In the admin >> Stores >> Configuration >> Local Options >> Locale is set to English (United Kingdom). Does that mean the proper locale is en_GB or en_UK? – Justin Nov 15 '17 at 12:55
  • the whole site went blank, after running the commands using 'php bin/magento setup:static-content:deploy en_GB' – Justin Nov 15 '17 at 16:10
  • Please deploy for en_GB en_US, because most of the file are taken from US locale. Do php bin/magento setup:static-content:deploy en_GB en_US – aton1004 Nov 17 '17 at 8:44
  • Thanks, but I have just reinstalled Magento. – Justin Nov 23 '17 at 12:45

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