7

I have installed the magento2 successfully but there are a lot of js error.

When see the console log through the firebug it shows a lot of errors and is there any thing else to config for the magento css and js.

enter image description here

Cœur
  • 37,241
  • 25
  • 195
  • 267

5 Answers5

6

try following :

  1. make bin/magento executable

    chmod +x bin/magento
    
  2. Clear cache etc in var folder

    rm -rf var/cache/ var/di/ var/generation/ var/page_cache/
    
  3. Run Setup ( if any thing missing )

    bin/magento setup:upgrade
    
  4. Deploy Static Content

    bin/magento setup:static-content:deploy
    
  5. Give Permission to var & pub folders

    chmod -R 777 pub/ var/
    

now all the static files containing js, css etc will be deployed in pub/static folder

Usman Maqbool
  • 3,351
  • 10
  • 31
  • 48
Emizen Tech
  • 3,529
  • 1
  • 17
  • 33
3

Remove all files and folder in pub/static except .htaccess and then run:

php bin/magento setup:static-content:deploy
user1579524
  • 81
  • 1
  • 4
  • Hello just tried that and got the following root@cloud [/home/thepurpl]# cd public_html root@cloud [/home/thepurpl/public_html]# php bin/magento setup:static-content:deploy Fatal error: Class 'Locale' not found in /home/thepurpl/public_html/vendor/magento/framework/Locale/Bundle/DataBundle.php on line 64 root@cloud [/home/thepurpl/public_html]# – Marc Smith Mar 30 '16 at 07:49
2

Problem solved ...

There is a 'cache' system for these static resources. navigate to the folder dev/tools/Magento/Tools/View

Run the below command in the terminal

php deploy.php

After running this command css and other files created under the Pub/static/ folder and all the css will appear and page look fine.

1

You can try after giving full permission to magento folder

1

I had the same problem. I've deleted .htaccess file from pub/static folder by mistake.

I copied the file from the original installation to pub/static directory.

Jas
  • 188
  • 1
  • 3
  • 16
Zielsko
  • 11
  • 2