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

Magento:加载静态资源失败-当语言不是默认语言时(en_US),magento,Magento,在本地主机上安装Magento后 跟随 Magento无法加载css、javascript(静态文件) 经过一些研究,我知道我必须运行php-bin/magento-setup:static-content:deploy,于是我就这样做了 cd /var/www/html/magento sudo php bin/magento setup:static-content:deploy 该工具部署了大量静态文件 $:/var/www/html/magento$ sudo php bin/mag

在本地主机上安装Magento后

跟随

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

经过一些研究,我知道我必须运行
php-bin/magento-setup:static-content:deploy
,于是我就这样做了

cd /var/www/html/magento
sudo php bin/magento setup:static-content:deploy
该工具部署了大量静态文件

$:/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
但加载静态资源仍然失败

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 

此magento设置为使用
pt_BR
作为语言,运行“sudo php bin/magento设置:静态内容:部署”将静态资源部署到默认语言(en_US)

该工具需要一个额外的参数来指定此参数

sudo php bin/magento setup:static-content:deploy pt_BR 
输出:

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

此magento设置为使用
pt_BR
作为语言,运行“sudo php bin/magento设置:静态内容:部署”将静态资源部署到默认语言(en_US)

该工具需要一个额外的参数来指定此参数

sudo php bin/magento setup:static-content:deploy pt_BR 
输出:

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