CSS and js are not loaded when new magento installation was done.Please refer screenshot for logs.

Please help me with the solution.

I am using nginx server.Conf is as follows

    upstream fastcgi_backend {
  server  unix:/var/run/php/php7.2-fpm.sock;

server {
  listen 80;
  server_name myshop.com www.myshop.com;
  set $MAGE_ROOT /home/ubuntu/myshop;
  include /home/ubuntu/myshop/nginx.conf.sample;
  • What is your document root in apache? Shoud be something like: /var/www/mysite/pub. – Mattia Kozianowski May 7 '20 at 11:04
  • run all command after check – Mohit Patel May 7 '20 at 11:19
  • I am using nginx – Gautam Bhalla May 7 '20 at 11:26
  • Mageroot is wrong, should be /home/ubuntu/myshop/pub – Mattia Kozianowski May 7 '20 at 11:53

nginx config looks ok (mage root is defined in nginx.conf.sample). Check your files owner and permissions. Also try to remove some generated files: https://devdocs.magento.com/guides/v2.3/howdoi/php/php_clear-dirs.html.

Did you set the project into development mode? Run the bin/magento deploy:mode:show in cli. If not set it to: bin/magento deploy:mode:set developer

  • What was the solution in your case? I’m just curious :) – Adam S. May 9 '20 at 11:37

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.