17

I've just installed Magento 2 onto my production server under a development. subdomain. The install appeared to have been successful but I've noticed there are no images or working javascript in both the frontend and the backend.

After inspecting the source code, I found that files being called in such as http://dev.website.com/pub/static/frontend/Magento/luma/en_GB/css/print.css don't actually exist. Any thoughts? I tried solutions on several stacks but haven't had any luck.

Magento 2

Magento 2

Liam McArthur
  • 1,319
  • 4
  • 20
  • 40
  • have you tried this --> http://stackoverflow.com/questions/30492838/installing-magento-2-does-not-deploy-the-pub-static-frontend-and-backend/30497630#30497630 – Vishwas Soni Jan 07 '16 at 08:25

5 Answers5

26

Try this Before that take Backup

Remove everything, except .htaccess file from pub/static folder

Open up app/etc/di.xml find the path “Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink” and replace to Magento\Framework\App\View\Asset\MaterializationStrategy\Copy

Note: Remove entire files and folder under pub/static except .htaccess file.

For More info ref this http://www.dckap.com/blog/magento-2-admin-links-not-working-in-windows/

Magento 2
  • 3,834
  • 7
  • 52
  • 107
17

You can run below command from magento root folder.

php bin/magento setup:static-content:deploy

This will download the content perfectly in respective folders.

Shyam
  • 1,690
  • 17
  • 31
3

If you are in default or development mode use -f to forcefully download static content. In development mode static content are downloaded automatically.

php bin/magento setup:static-content:deploy -f
bikram kc
  • 161
  • 2
2

If you see that Magento is trying to load from a folder other than en_US, you can try to deploy static content in the appropriate folder as below

bin/magento setup:static-content:deploy en_GB en_AU
Saroj
  • 477
  • 5
  • 14
1

I had the same issue after installing magento 2.1.1 and followed the steps mentioned below

  1. Add D:\xampp\php to your PATH Environment Variable. Then Close The Command Prompt And Restart Again. Its important because if you didn't restart you command prompt then changes will not reflect.

Follow this link for guidance on adding path variable: https://www.java.com/en/download/help/path.xml

  1. Navigate to your mangento root directory (Eg: D:/xampp/mangento/) through command prompt

  2. Run the command php bin/magento setup:static-content:deploy

This worked for me. Hope it helps others!

VinayakJoshi
  • 23
  • 1
  • 7