cancel
Showing results for 
Search instead for 
Did you mean: 

CSS and JS files not loaded after installation (Wamp64)

SOLVED

CSS and JS files not loaded after installation (Wamp64)

I have tried all of them on this page:

https://community.magento.com/t5/Installing-Magento-2-x/CSS-not-loading-in-the-front-and-backend-aft...

 

The system is Windows 10 Home.

 

 

GET http://127.0.0.1/magento2/pub/static/frontend/Magento/luma/en_GB/mage/calendar.css 500 (Internal Server Error)
(index):16 GET http://127.0.0.1/magento2/pub/static/frontend/Magento/luma/en_GB/css/styles-m.css 500 (Internal Server Error)
(index):22 GET http://127.0.0.1/magento2/pub/static/frontend/Magento/luma/en_GB/mage/requirejs/mixins.js 500 (Internal Server Error)
(index):23 GET http://127.0.0.1/magento2/pub/static/frontend/Magento/luma/en_GB/requirejs-config.js 500 (Internal Server Error)
(index):21 GET http://127.0.0.1/magento2/pub/static/frontend/Magento/luma/en_GB/requirejs/require.js 500 (Internal Server Error)
(index):22 GET http://127.0.0.1/magento2/pub/static/frontend/Magento/luma/en_GB/mage/requirejs/mixins.js 500 (Internal Server Error)
(index):245 GET http://127.0.0.1/magento2/pub/static/frontend/Magento/luma/en_GB/images/logo.svg 500 (Internal Server Error)
(index):23 GET http://127.0.0.1/magento2/pub/static/frontend/Magento/luma/en_GB/requirejs-config.js 500 (Internal Server Error)
(index):146 Uncaught TypeError: require.config is not a function
at (index):146
(anonymous) @ (index):146
(index):17 GET http://127.0.0.1/magento2/pub/static/frontend/Magento/luma/en_GB/css/styles-l.css 500 (Internal Server Error)
(index):18 GET http://127.0.0.1/magento2/pub/static/frontend/Magento/luma/en_GB/css/print.css 500 (Internal Server Error)
2favicon.ico:1 GET http://127.0.0.1/magento2/pub/static/frontend/Magento/luma/en_GB/Magento_Theme/favicon.ico 500 (Internal Server Error)

17 REPLIES

Re: CSS and JS files not loaded after installation (Wamp64)

You need to run below command,

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f en_US en_GB
If Issue Solved, Click Kudos/Accept As solutions.

Re: CSS and JS files not loaded after installation (Wamp64)

Same here.

 

I received an error on bash:

 

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 962560 bytes) in C:\wamp64\www\magento2\app\code\Magento\Deploy\Package\Bundle\Requir
eJs.php on line 226

Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.

 

 

The memory found on bash is 128M

$ php -r "echo ini_get('memory_limit').PHP_EOL;"
128M

 

However, on php.ini it;s 2GS

; http://php.net/memory-limit
memory_limit = 2GS

 

Re: CSS and JS files not loaded after installation (Wamp64)

You need to run below command,

php -dmemory_limit=5G bin/magento setup:upgrade
php -dmemory_limit=5G bin/magento setup:static-content:deploy -f en_US en_GB
If Issue Solved, Click Kudos/Accept As solutions.

Re: CSS and JS files not loaded after installation (Wamp64)

You can extend memory limit for particular command by `-d memory_limit=2G`.

So, you need to add like this `php -dmemory_limit=2G bin/magento  {{Your commannd}}`.

 

Re: CSS and JS files not loaded after installation (Wamp64)

It didn't fix the problem.

The files are created, but it gives 500 error.

Re: CSS and JS files not loaded after installation (Wamp64)

Have you check your magento instance with root file and pub folder have .hraccess file or not?

If not create .htaccess file and keep code from github.
If Issue Solved, Click Kudos/Accept As solutions.

Re: CSS and JS files not loaded after installation (Wamp64)

This is in the error log.

[Sun May 27 17:58:44.264257 2018] [core:alert] [pid 10216:tid 1196] [client 127.0.0.1:65438] C:/wamp64/www/magento2/pub/.htaccess: Invalid command '+############################################', perhaps misspelled or defined by a module not included in the server configuration, referer: http://127.0.0.1/magento2/

Re: CSS and JS files not loaded after installation (Wamp64)

@Rakesh Jesadiya

Hi,  yes there is .htaccess file in pub folder.

 

I now have copied the file from https://github.com/magento/magento2/blob/2.2-develop/pub/.htaccess.

 

but it still the same.

Re: CSS and JS files not loaded after installation (Wamp64)

@Rakesh Jesadiya

Hi

How I can check Magento Instance with root file?