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?
-
nope, nothing resolved the issue yet – Sukeshini Nov 05 '15 at 11:21
5 Answers
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
- 13,911
- 2
- 33
- 52
Looks like UrlRewrite module is disabled in Apache configuration. Please try solution from Magento Documentation
- 20,811
- 3
- 49
- 59
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.
- 18,046
- 6
- 66
- 80
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.
- 438
- 1
- 7
- 17
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.
- 197,939
- 53
- 422
- 830
- 9
- 4
