cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.2 css not working

SOLVED

Magento 2.2 css not working

Hello,

 

I have installed Magento 2.2.2 and after install, I see only text from website. Css doesn't load.

I found some solutions for example:

  • Clear cache etc in var folder

    rm -rf var/cache/ var/di/ var/generation/ var/page_cache/
  • Run Setup ( if any thing missing )

    bin/magento setup:upgrade
  • Deploy Static Content

    bin/magento setup:static-content:deploy
  • Give Permission to var & pub folders

    chmod -R 777 pub/ var/

It doesn't help. I have PHP 7.1. Apache mod rewrite is enabled. I also contact hosting support and they said, the site will access to

/pub/static/version1513840448/frontend/Magento/luma/en_US/css/styles-m.css

But this file doesn't exist. I don't have folder "/pub/static/version1513...." . I have only /pub/adminhtml, /pub/frontend and /pub/deployed_version.txt .

I don't know why it doesn't work.

 

Can you help me please?

 

Best Regards,

Mert

 

Bildschirmfoto 2017-12-21 um 12.14.48.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Magento 2.2 css not working

I have solved the problem. Magento want access to a dynamic folder "/pub/static/Version1513859926" which I don't create it. I create folder Version1513.... and then Magento load css file. It is a dynamic folder, so Magento edit Versionnumber and so I edited this option in config Stores>Configuration>Advanced>Developer>Sign Static Files (dev_static_sign) -> No.

Now my site loads css from "/pub/static/adminhtml" (or frontend)

 

Regards,

Mert

View solution in original post

18 REPLIES 18

Re: Magento 2.2 css not working

I have solved the problem. Magento want access to a dynamic folder "/pub/static/Version1513859926" which I don't create it. I create folder Version1513.... and then Magento load css file. It is a dynamic folder, so Magento edit Versionnumber and so I edited this option in config Stores>Configuration>Advanced>Developer>Sign Static Files (dev_static_sign) -> No.

Now my site loads css from "/pub/static/adminhtml" (or frontend)

 

Regards,

Mert

Re: Magento 2.2 css not working

Hi my friend

 

How did you get change the config, once it's not possible load the config?

Re: Magento 2.2 css not working

Hi,

 

How did you change this setting? If I want to change the Sign Static Files, it is disabled.

Re: Magento 2.2 css not working

Hi @SiiW

 

You can change this settings by login to your magento admin panel -> then go to Stores>Configuration>Advanced>Developer>Sign Static Files (dev_static_sign) -> No.

 

You can also disable this from database by running below query : 

insert into core_config_data (config_id, scope, scope_id, path, value) values (null, 'default', 0, 'dev/static/sign', 0);
if issue solved,Click Kudos & Accept as Solution

Re: Magento 2.2 css not working

Hi @Manthan Dave,

 

I can't change this option. See the image below:

Screen Shot 2018-05-04 at 11.57.27.pngAlso the SQL query doesn't work. I don't get an error, but it doesn't change anything.

Re: Magento 2.2 css not working

Hello,

 

if you don't want to change option then make sure .htaccess file there.

 

https://github.com/magento/magento2/tree/2.2-develop/pub/static

 

Hope it will help you


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Magento 2.2 css not working

Hi @SiiW

 

okay i understand - kindly run Update query into your database :

 

UPDATE core_config_data SET value = 0 WHERE path LIKE 'dev/static/sign';

 

 

It will works for you !!

if issue solved,Click Kudos & Accept as Solution

Re: Magento 2.2 css not working

Hi @Sunil Patel,

 

The .htaccess file is there and I updated the file. Unfortunately it doesn't change anything at all.

 

 

Re: Magento 2.2 css not working

Okay, I found the solution. The media folder was not up to date. I exported the media folder on PC 1 and placed it in the media folder of PC 2. Everything works now.