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

  • 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. – kunj Jun 8 '18 at 4:57
  • @kunj, I am not working on css. i am just only running command setup:upgrade – amit_game Jun 8 '18 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. – kunj Jun 8 '18 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 – amit_game Jun 8 '18 at 6:12
  • Try after delete pub/static/* and do you have .htaccess in pub and static folder. – kunj Jun 8 '18 at 6:15
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.