专注于zen cart的二次开发 >> magento >> magento 2.x 中css,字体,js等文件的404问题(图片图标字体css缺失)

两个可能原因:
1、权限:
$ rm -rf pub/static/*
$ php bin/magento setup:static-content:deploy

2、When Magento 2 is not in production mode, it will try to create symlinks for some static resources on local server. We have to change that behavior of Magento 2 by going to edit ROOT > app > etc > di.xml file. Open up di.xml in your favorite code editor, find the virtualType name=”developerMaterialization” section. In that section below, you will find an item which needs to be modified. You can modify it by changing the following content:

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

Magento\Framework\App\View\Asset\MaterializationStrategy\Copy
Now last step, also delete old files generated in ROOT > pub > static > DELETE ALL EXCEPT .HTACCESS

Clear / Flush Magento cache by typing “php bin/magento cache:flush” in CMD.

And finally, to Reindex Magento Static Blocks type “php bin/magento indexer:reindex”.

You are done with successful installation of Magento 2.

你可以发表评论引用到你的网站或博客,或通过RSS 2.0订阅这个日志的所有评论。
上一篇:
下一篇:
没有评论
我来说两句

  Ctrl+Enter