【问题标题】:Css not loading in my VPS for magento 2Css 没有在我的 VPS 中加载 magento 2
【发布时间】:2016-01-17 18:47:05
【问题描述】:

清除缓存, 授予对 maganto 目录中所有文件和文件夹的 777 权限, 仍然没有解决方案..

我什至无法访问管理面板,因为链接无法正常工作。

这是一个全新的安装,我做到了

git clone magento_https_link

link 是 magento2 @ github 的 github 链接。

一切顺利,我按照官方教程,安装了composer的东西,我安装了它,按照步骤到最后,安装完成后,我点击了前端,没有css,和后端,没有css。 Css 在安装过程中运行良好。

当我按 F12 并切换到控制台时,它在 css 、 javascript 和图像文件上显示错误 404。如果我尝试手动访问任何 css 的 url,它们都不存在。真的很奇怪。

而且我不知道什么是 css js 合并。不知道这个。

我在数据库中的核心配置:

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)

【问题讨论】:

  • 您好,index.php 目前是否运行,您可以放置​​一个 die() 函数进行交叉检查吗?
  • 是的,它运行。反正我用的是git clone的东西,不是我从magento官网下载上传的,效果很好,git版本有问题..

标签: php css magento vps magento2


【解决方案1】:

您是否使用 bin/magento 安装程序执行了所有需要的步骤?

听起来你应该尝试做(在你的根 magento 类别中):

bin/magento setup:static-content:deploy

如果这有帮助,请告诉我。

【讨论】:

    【解决方案2】:
    【解决方案3】:

    只需打开 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>
    

    【讨论】:

      【解决方案4】:

      Magento2 有这个初始问题,但请按照以下步骤进行操作!

      第 1 步:运行 CMD
      第 2 步:使用转到 Magento 安装目录

      CD wamp/www/[Magento 目录]

      第 3 步:运行

      php bin/magento setup:static-content:deploy


      第 4 步:运行

      php bin/magento 索引器:重新索引


      第 5 步:从

      中删除缓存

      var/cache/[删除所有目录]


      前端和后端开始工作了!

      http://developerforums.blogspot.com/

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2017-03-15
        • 2016-03-06
        • 1970-01-01
        • 2015-09-22
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多