您好我安装了最新版本的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但没有结果似乎是在请求中加入版本号这可能是个问题吗?
答案 0 :(得分:0)
按照以下步骤操作:
在Magento网站根目录 -
第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
下的缓存文件夹以上步骤正常工作。我希望这对你也有用。