1

I have installed Magento2 on my localhost. But it doesn't load the CSS and JS files. Admin interface is as below. Frontend also have the same issue. I set the file permissions. How to fix this?

enter image description here

1
  • nope, nothing resolved the issue yet
    – Sukeshini
    Commented Nov 5, 2015 at 11:21

5 Answers 5

1

Deleting the pub/static folder should work.

But also try php bin/magento setup:static-content:deploy or php bin/magento setup:upgrade from the root folder

See CSS and Javascript files are not loading after Magento 2 installation

0

Looks like UrlRewrite module is disabled in Apache configuration. Please try solution from Magento Documentation

0

Allow the loading of htaccess files and usage of rewrite rules.I have same problem occur, Enabling rewrite_module of apache works for me.

Or try to delete the pub/static folder.

0

Look into

\app\etc\di.xml and find the

virtualType name="developerMaterialization" .

In this you'll find an item name="view_preprocessed" and change its content

from

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

to

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

then delete the files under pub/static except .htaccess file and reload the site.

It should work for you.

-1

If you are facing problem of css and js page load design after installation in magento2

please follow the following step-:

open the terminal and navigate to magento web root

 $ cd /var/www/html/magento2

Step 1.

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

Step 2.

$ php bin/magento indexer:reindex

Step 3.

make sure apache "rewrite_module" is enable and then restart the server

Step 4.

$ chown -R www-data:www-data /var/www/html/magento2 

Step 5.

$ chmod -R 777 /var/www/html/magento2 

Step 6.

delete cache folder under var/cache

The above step working. I hope this will work for you also.

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.