1

I am using PHP Version 7.1.11 with Magento 2.2.4.

Using XAMPP with Windows 8.1

Each time when use setup:upgrade command my CSS get lost and do not load. Then I have to run static-content:deploy command. Why this is happening each time, I am working in developer mode still this issue is coming.

I also have gone through some articles in stack overflow but they are not working for me. one of the article has the same issue but still that is not working for me.

Problem setup:upgrade with CSS

Need help in understanding the exact issue.

Thanks

asked Jun 8, 2018 at 4:55
8
  • have added your CSS in pub/static/ folder and after setup:upgrade we must do static content deploy. Some time it is not working with developer mode. Commented Jun 8, 2018 at 4:57
  • @kunj, I am not working on css. i am just only running command setup:upgrade Commented Jun 8, 2018 at 4:58
  • basically, it works for me in developer mode. magento auto generates pub/static data but same not working for my one colleague with the same source and same configuration but he has not disabled cache from admin. Commented Jun 8, 2018 at 5:24
  • @kunj, yes Right, but it is not working for me, don't know what point I am missing , I am using windows xampp on localhost, and setup other versions of magento 2 , and still same issue is coming for me Commented Jun 8, 2018 at 6:12
  • Try after delete pub/static/* and do you have .htaccess in pub and static folder. Commented Jun 8, 2018 at 6:15

1 Answer 1

0

Please run below commands, it should fix. Please replace user and group with your correct web user & group Example, in ubuntu default: user = www-data & group = www-data ie, chown -R www-data:www-data .

chown -R user:group .
rm -rf var/cache/*
rm -rf var/page_cache/*
rm -rf var/view_preprocessed/*
rm -rf pub/static/*
rm -rf generated/*
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy en_US -f
find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} \;
find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} \;
chown -R user:group .
chmod u+x bin/magento
answered Jun 8, 2018 at 5:59

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.