簡體   English   中英

無法在Magento 2的VPS中加載CSS

[英]Css not loading in my VPS for magento 2

已清除緩存,對maganto目錄中的所有文件和文件夾具有777權限,仍然沒有解決方案。

我什至無法訪問管理面板,因為鏈接無法正常工作。

這是全新安裝,我做到了

git clone magento_https_link

其中link是magento2 @ github的github鏈接。

一切順利,我遵循了官方教程,安裝了composer東西,然后安裝完畢,按照步驟進行到最后,安裝完成后,我單擊了前端,沒有css,單擊了后端,沒有css。 CSS在安裝過程中工作正常。

當我按F12鍵並切換到控制台時,它在css,javascript和圖像文件上顯示錯誤404。 而且,如果我嘗試手動訪問任何CSS的網址,它們都不存在。 真的很奇怪

而且我不知道什么是css js merge。 對此一無所知。

我在數據庫中的核心配置:

mysql> select * from `core_config_data`;
+-----------+---------+----------+-------------------------------+------------------------------------------+
| config_id | scope   | scope_id | path                          | value                                    |
+-----------+---------+----------+-------------------------------+------------------------------------------+
|         1 | default |        0 | web/seo/use_rewrites          | 1                                        |
|         2 | default |        0 | web/unsecure/base_url         | http://NAME_OF_SITE/magento/magento2/  |
|         3 | default |        0 | web/secure/base_url           | https://NAME_OF_SITE/magento/magento2/ |
|         4 | default |        0 | general/locale/code           | en_US                                    |
|         5 | default |        0 | web/secure/use_in_frontend    | NULL                                     |
|         6 | default |        0 | web/secure/use_in_adminhtml   | NULL                                     |
|         7 | default |        0 | general/locale/timezone       | XX/XX                             |
|         8 | default |        0 | currency/options/base         | XX                                      |
|         9 | default |        0 | currency/options/default      | XX                                      |
|        10 | default |        0 | currency/options/allow        | XX                                      |
|        11 | default |        0 | general/region/display_all    | 1                                        |
|        12 | default |        0 | general/region/state_required | AT,BR,CA,CH,DE,EE,ES,FI,FR,LT,LV,RO,US   |
|        13 | default |        0 | catalog/category/root_id      | NULL                                     |
+-----------+---------+----------+-------------------------------+------------------------------------------+
13 rows in set (0.00 sec)

您是否使用bin / magento安裝程序執行了所有必需的步驟?

聽起來您應該嘗試做(在您的root magento類別中):

bin/magento setup:static-content:deploy

請讓我知道這可不可以幫你。

Magento2最初有此問題,但請按照以下步驟操作!

步驟1:執行CMD
第2步:使用以下命令轉到Magento安裝目錄

CD wamp / www / [Magento目錄。]

步驟3:執行

php bin / magento設置:靜態內容:部署


步驟4:執行

php bin / magento索引器:reindex


步驟5:從中刪除緩存

var / cache / [刪除所有目錄。]


它正在為前端和后端工作!

http://developerforums.blogspot.com/

只需打開MAGENTO_ROOT/app/etc/di.xml並替換第574行下面的代碼

<item name="view_preprocessed" xsi:type="object">Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink</item>

<item name="view_preprocessed" xsi:type="object">Magento\Framework\App\View\Asset\MaterializationStrategy\Copy</item>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM