【问题标题】:Magento 2 Install Windows Admin Broken LinksMagento 2 安装 Windows 管理员损坏的链接
【发布时间】:2019-06-03 15:10:25
【问题描述】:

我在 Windows 10 上使用 XAMPP。我安装了 Magento 2.20 社区。我的管理员网址都坏了:

我应该使用其他版本吗?我试图运行这篇文章中的命令:

Magento 2 - Links in Admin wont work

在我的控制台中,我看到以下错误:

/Magento2/pub/static/version1559572638/adminhtml/Magento/backend/en_US/extjs/resources/css/ytheme-magento.css:1 Failed to load resource: net::ERR_CONNECTION_RESET
/Magento2/pub/static/version1559572638/adminhtml/Magento/backend/en_US/extjs/resources/css/ext-all.css:1 Failed to load resource: net::ERR_CONNECTION_RESET
require.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
(index):1 Refused to apply style from 'http://localhost/Magento2/pub/static/version1559572638/adminhtml/Magento/backend/en_US/jquery/jstree/themes/default/style.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
mixins.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
requirejs-config.js:71 Uncaught TypeError: require is not a function
    at requirejs-config.js:71
    at requirejs-config.js:78
    at requirejs-config.js:416
magento-icon.svg:1 Failed to load resource: the server responded with a status of 404 (Not Found)
(index):38 Uncaught TypeError: require.config is not a function
    at (index):38
(index):87 Uncaught TypeError: require is not a function
    at (index):87
(index):295 Uncaught TypeError: require is not a function
    at (index):295
(index):428 Uncaught TypeError: require is not a function
    at (index):428
(index):473 Uncaught TypeError: require is not a function
    at (index):473
(index):514 Uncaught TypeError: require is not a function
    at (index):514
(index):537 Uncaught TypeError: require is not a function
    at (index):537
(index):560 Uncaught TypeError: require is not a function
    at (index):560
admin-icons.woff2:1 Failed to load resource: the server responded with a status of 404 (Not Found)
opensans-400.woff2:1 Failed to load resource: the server responded with a status of 404 (Not Found)
opensans-600.woff2:1 Failed to load resource: the server responded with a status of 404 (Not Found)
opensans-700.woff2:1 Failed to load resource: the server responded with a status of 404 (Not Found)
admin-icons.woff:1 Failed to load resource: the server responded with a status of 404 (Not Found)
opensans-700.woff:1 Failed to load resource: the server responded with a status of 404 (Not Found)
admin-icons.ttf:1 Failed to load resource: the server responded with a status of 404 (Not Found)
opensans-600.woff:1 Failed to load resource: the server responded with a status of 404 (Not Found)
opensans-400.woff:1 Failed to load resource: the server responded with a status of 404 (Not Found)
opensans-700.ttf:1 Failed to load resource: the server responded with a status of 404 (Not Found)
opensans-600.ttf:1 Failed to load resource: the server responded with a status of 404 (Not Found)
opensans-400.ttf:1 Failed to load resource: the server responded with a status of 404 (Not Found)

【问题讨论】:

标签: php magento magento2


【解决方案1】:

尽管我使用 WAMP,但我在 Windows 上成功运行 Magento 2(用于开发)。我的设置方法如下(我从另一个 stackexchange Q&A 改编但找不到它)。请注意,我的语言环境是 en_GB,请在下面替换您的:

  1. 运行 grunt clean 会快速清理下面的几个文件夹 (*)
  2. *删除变量/缓存
  3. *删除 var/view_preprocessed
  4. *delete pub/static/*(不要删除 .htaccess)
  5. 删除生成的/* 而不是 .htaccess
  6. 删除 var/composer_home
  7. 运行 php bin/magento cache:flush
  8. 运行 php bin/magento setup:static-content:deploy --theme YOUR/theme en_GB [en_GB is essential]
  9. 运行 php bin/magento setup:static-content:deploy --theme Magento/backend en_GB [en_GB 必不可少]
  10. 从 pub/static/frontend 中删除所有您实际上不使用的主题/语言
  11. 运行 php bin/magento dev:source-theme:deploy --locale="en_GB" --theme="YOUR/theme" css/styles-m css/styles-l css/email css/email-inline
  12. 下面的 grunt 命令需要以管理员身份运行
  13. 如果您已完成升级,请复制包含主题定义的有效 dev\tools\grunt\configs\theme.js(因为它会被覆盖)
  14. 根本不要运行 grunt exec
  15. 运行 grunt less:yourtheme(可能还有 :backend)

【讨论】:

    【解决方案2】:

    不知道以下能否帮到你,请查收。

    在您的屏幕截图中,我可以看到您已经在 magento/bin 路径中,所以在这里您必须运行以下命令

    sudo magento setup:upgrade
    

    对于第二个命令,你在命令中使用了两个 php。

    • 首先注意:Magento2 不支持 windows 版本。但是,可以运行。
    • 如果您正在安装 magento2.2,请确保您使用的是 php7 或 7x,magento2.2 将不支持旧版本。
    • 检查您的 apache2 a2enmode 是否启用,因为它会导致重定向问题。
    • 检查您的所有文件是否具有足够的加载权限,对于您的本地文件,您可以检查是否授予 app/etc、var/、pub/static/、generate/* 的完全权限。
    • 一切设置好后,尝试使用 php 运行部署命令。

    如果不需要,您可以避免使用 sudo。或者转到 magento root 并运行您已经尝试实现的早期命令。

    希望这能帮助您解决问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-10-19
      • 1970-01-01
      • 2017-05-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-31
      • 2015-06-30
      相关资源
      最近更新 更多