繁体   English   中英

无法在Magento中加载CSS和JS

[英]CSS and JS not loading in Magento

嗨,我已经安装了最新版本的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并删除了requirejs-config,但是没有结果,似乎是在请求中放了一个版本号,这可能问题?

请按照以下步骤操作:

在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

步骤五

$ 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下的缓存文件夹

以上步骤正常工作。 我希望这也对您有用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM