嗨,我已经安装了最新版本的Magento,但它没有加载任何CSS或JS文件。
我已经在WAMP上本地安装了但是没有出现任何错误。 JS控制台说:
GET http://127.0.0.1/magento/pub/static/version1514906660/adminhtml/Magento/backend/en_GB/extjs/resources/css/ext-all.css net::ERR_ABORTED
(index):23 GET http://127.0.0.1/magento/pub/static/version1514906660/adminhtml/Magento/backend/en_GB/mage/requirejs/mixins.js net::ERR_ABORTED
(index):17 GET http://127.0.0.1/magento/pub/static/version1514906660/adminhtml/Magento/backend/en_GB/extjs/resources/css/ytheme-magento.css net::ERR_ABORTED
(index):19 GET http://127.0.0.1/magento/pub/static/version1514906660/adminhtml/Magento/backend/en_GB/css/styles.css net::ERR_ABORTED
(index):18 GET http://127.0.0.1/magento/pub/static/version1514906660/adminhtml/Magento/backend/en_GB/jquery/jstree/themes/default/style.css net::ERR_ABORTED
(index):22 GET http://127.0.0.1/magento/pub/static/version1514906660/adminhtml/Magento/backend/en_GB/requirejs/require.js net::ERR_ABORTED
(index):126 GET http://127.0.0.1/magento/pub/static/version1514906660/adminhtml/Magento/backend/en_GB/images/magento-logo.svg 404 (Not Found)
(index):23 GET http://127.0.0.1/magento/pub/static/version1514906660/adminhtml/Magento/backend/en_GB/mage/requirejs/mixins.js 404 (Not Found)
requirejs-config.js:16 Uncaught TypeError: require.config is not a function
at requirejs-config.js:16
at requirejs-config.js:17
at requirejs-config.js:440
(anonymous) @ requirejs-config.js:16
(anonymous) @ requirejs-config.js:17
(anonymous) @ requirejs-config.js:440
(index):28 Uncaught TypeError: require.config is not a function
at (index):28
(anonymous) @ (index):28
(index):77 Uncaught TypeError: require is not a function
at (index):77
去了\ magento \ pub \ static \ adminhtml \ Magento \ backend \ en_GB并在对同一个问题做了一些研究之后删除了requiresjs-config但是没有结果似乎是在请求中加入版本号这是可能的问题?
请按照以下步骤进行操作:
在Magento web root中 -
第1步.$ php bin/magento setup:static-content:deploy
第2步.$ php bin/magento indexer:reindex
步骤3.确保启用apache“rewrite_module”,然后重新启动服务器
第4步。$ chown -R www-data:www-data /var/www/html/magento2
第5步。
$ chmod -R 775 /var/www/html/magento2/
$ chmod -R 777 /var/www/html/magento2/var/
$ chmod -R 777 /var/www/html/magento2/pub/
步骤6.删除var / cache下的缓存文件夹
以上步骤正常工作。我希望这对你也有用。