Magento 2安装Windows管理员断开的链接

时间:2019-06-03 15:10:25

标签: php magento magento2

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

enter image description here

我应该使用另一个版本吗?我试图从这篇文章中运行命令:

Magento 2 - Links in Admin wont work

enter image description here

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

/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)

2 个答案:

答案 0 :(得分:0)

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

  1. 运行grunt clean,它将快速清除下面的几个文件夹(*)
  2. *删除var / cache
  3. *删除var / view_preprocessed
  4. *删除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是必不可少的
  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 < / li> 以下
  12. grunt命令需要以管理员身份运行
  13. 如果您进行了升级(因为它被覆盖),请复制包含主题定义的有效dev \ tools \ grunt \ configs \ theme.js
  14. 完全不要运行grunt exec
  15. 减少咕gr声:您的主题(可能还有:后端)

答案 1 :(得分:0)

不知道以下内容是否对您有帮助,请检查。

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

sudo magento setup:upgrade

对于第二个命令,您正在命令中使用两个php。

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

如果不需要,可以避免使用sudo。否则,请转到magento root并运行您已经尝试实现的先前命令。

希望这可以帮助您进行梳理。