【问题标题】:Magento prod site clone not working like prodMagento prod 站点克隆不像 prod 那样工作
【发布时间】:2017-06-28 05:54:56
【问题描述】:

我看到生产克隆站点的输出与生产环境不同。到目前为止,我能看到的最明显的区别(可能还有更多)是主文档中的 js/css 引用在生产环境中看起来已经被缩小了:

<link rel="stylesheet" type="text/css" href="https://www.example.com/media/css_secure/eb0df35e22a81d2150af7faddb2a014c-v2.18.css" media="all" />
<script type="text/javascript" src="https://www.example.com/media/js/f081fea0e1f96e90201edfc964382601-v2.18.js"></script>

但在我的生产克隆中,它们会像这样返回:

<link rel="stylesheet" type="text/css" href="/git/magento/skin/frontend/responsive/default/css/styles.css" media="all" />
<link rel="stylesheet" type="text/css" href="/git/magento/skin/frontend/base/default/css/widgets.css" media="all" />
<link rel="stylesheet" type="text/css" href="/git/magento/skin/frontend/base/default/css/amasty/amfpc/styles.css" media="all" />
<link rel="stylesheet" type="text/css" href="/git/magento/skin/frontend/responsive/default/css/AutoComplete.css" media="all" />
...
<script type="text/javascript" src="/git/magento/js/prototype/prototype.min.js"></script>
<script type="text/javascript" src="/git/magento/js/lib/ccard.min.js"></script>
<script type="text/javascript" src="/git/magento/js/prototype/validation.min.js"></script>
<script type="text/javascript" src="/git/magento/js/scriptaculous/builder.min.js"></script>
...

我看到了两个问题:

  1. 我希望我的克隆拥有与 prod 相同的缩小 CSS 和 JS
  2. 克隆的 CSS 和 JS url 以“/git/magento”开头,这实际上是我在磁盘上的 Magento ROOT 文件夹的名称,所以这是不对的,它们都返回为 404。

当我进行生产克隆时,我没有带入/media 中的任何文件(这是我得到的建议)。有什么我应该做的不同的事情吗?我也按照以下步骤操作:https://magento.stackexchange.com/questions/35087/how-can-we-stop-a-magento-site-clone-from-redirecting-back-to-live-site

为什么相同的代码返回不同的 CSS 和 JS 引用?

【问题讨论】:

    标签: magento-1.8


    【解决方案1】:

    发现问题。我必须创建 MAGENTO_ROOT/var 和 MAGENTO_ROOT/media 文件夹并赋予它们正确的权限。这很有帮助:http://devdocs.magento.com/guides/m1x/install/installer-privileges_after.html#privs-after

    我猜问题是 /media 文件夹不可写入 web 服务器进程,所以它无法保存 js/css 的缩小/缓存版本。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-06-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多