首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Magento:加载静态资源失败-当语言不是默认的(en_US)

Magento:加载静态资源失败-当语言不是默认的(en_US)
EN

Stack Overflow用户
提问于 2017-05-10 16:08:52
回答 1查看 689关注 0票数 0

在本地主机上安装Magento之后

跟随本指令

Magento无法加载css、javascript (静态文件)

经过一些研究后,我知道我必须运行php bin/magento setup:static-content:deploy,所以我做了

代码语言:javascript
复制
cd /var/www/html/magento
sudo php bin/magento setup:static-content:deploy

该工具部署了大量静态文件。

代码语言:javascript
复制
$:/var/www/html/magento$ sudo php bin/magento setup:static-content:deploy
Requested languages: en_US
Requested areas: frontend, adminhtml
Requested themes: Magento/blank, Magento/luma, Magento/backend
=== frontend -> Magento/blank -> en_US ===
=== frontend -> Magento/luma -> en_US ===
=== adminhtml -> Magento/backend -> en_US ===
................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Successful: 2136 files; errors: 0
---

........................................................
Successful: 2061 files; errors: 0
---

............................................................................................................................................................................................................................................
Successful: 2012 files; errors: 0
---

=== Minify templates ===

Successful: 869 files modified
---

New version of deployed files: 1494363632

但是加载静态资源仍然失败。

代码语言:javascript
复制
Failed to load resource: the server responded with a status of 404 (Not Found) /magento/pub/static/version1494362497/frontend/Magento/luma/pt_BR/css/print.css 
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-05-10 16:08:52

这个magento被设置为使用pt_BR作为语言,运行'sudo /magento设置:静态内容:部署‘将静态资源部署到默认语言(en_US)。

该工具需要额外的param来指定以下内容

代码语言:javascript
复制
sudo php bin/magento setup:static-content:deploy pt_BR 

产出:

代码语言:javascript
复制
Requested languages: pt_BR
Requested areas: frontend, adminhtml
Requested themes: Magento/blank, Magento/luma, Magento/backend
=== frontend -> Magento/blank -> pt_BR ===
=== frontend -> Magento/luma -> pt_BR ===
=== adminhtml -> Magento/backend -> pt_BR ===
...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Successful: 2012 files; errors: 0
---

.......................................................................................................................................................................................................................................................................................................................................................
Successful: 2061 files; errors: 0
---

..................................................................................................................................................................................................................................................
Successful: 2136 files; errors: 0
---

=== Minify templates ===

Successful: 869 files modified
---

New version of deployed files: 1494363897
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43897721

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档