简体   繁体   English

无法在Magento中加载CSS和JS

[英]CSS and JS not loading in Magento

Hi I have installed the latest version of Magento but it is not loading any CSS or JS files. 嗨,我已经安装了最新版本的Magento,但是它没有加载任何CSS或JS文件。

Ihave it installed locally on WAMP but am not getting any Errors there. 我已经将其本地安装在WAMP上,但那里没有任何错误。 The JS console says: 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

went to \\magento\\pub\\static\\adminhtml\\Magento\\backend\\en_GB and removed the requiresjs-config after doing a bit of research in to the same issue but no results it seems to be putting a version number into the request is this possibly the issue? 在对同一问题进行了一些研究之后,去了\\ magento \\ pub \\ static \\ adminhtml \\ Magento \\ backend \\ en_GB并删除了requirejs-config,但是没有结果,似乎是在请求中放了一个版本号,这可能问题?

Follow the following step-: 请按照以下步骤操作:

In Magento web root- 在Magento网站根目录-

Step 1. $ php bin/magento setup:static-content:deploy 步骤1. $ php bin/magento setup:static-content:deploy

Step 2. $ php bin/magento indexer:reindex 步骤2. $ php bin/magento indexer:reindex

Step 3. make sure apache “rewrite_module” is enable and then restart the server 步骤3.确保已启用apache“ rewrite_module”,然后重新启动服务器

Step 4. $ chown -R www-data:www-data /var/www/html/magento2 步骤4. $ chown -R www-data:www-data /var/www/html/magento2

Step 5. 步骤五

$ chmod -R 775 /var/www/html/magento2/ 
$ chmod -R 777 /var/www/html/magento2/var/
$ chmod -R 777 /var/www/html/magento2/pub/

Step 6. delete cache folder under var/cache 步骤6.删除var / cache下的缓存文件夹

The above step working. 以上步骤正常工作。 I hope this will work for you also. 我希望这也对您有用。

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

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