cancel
Showing results for 
Search instead for 
Did you mean: 

CSS broken after changing server to client

CSS broken after changing server to client

Hi,

 

I modified the "Frontend Development Workflow" from server to client and by refreshing the page, everything was broken, home page and admin.

 

So I did a "setup: static-content: deploy -f" But I have a long list of errors :

Compilation from source D:/xamp/htdocs/magento2/lib/web/mage/gallery/gallery.less failed
Magento\Framework\Exception\FileSystemException: A symlink for "D:/xamp/htdocs/magento2/lib/web/mage/gallery/module/_variables.less" can't be created and placed to "D:/xamp/htdocs/magento2/pub/static/frontend/Magento/blank/fr_FR/mage/gallery/module/_variables.less". Warning!symlink(): Permission denied in D:\xamp\htdocs\magento2\vendor\magento\framework\Filesystem\Driver\File.php:418

 

 So I gave all the rights (right click on vendor and static -> properties / security -> User (MEMO \ users) -> total control)

But nothing, there always makes the same mistake.

However, according to the messages, it is indeed a problem of permission access.

If I go to the command line in administrator mode, it works but when the page loads, but it is broken for 1 second, then load the css... it's not normal, bBut anyway I don't want to give a command line in administrator mode to "anyone"

 

I am in developer mode

magento 2.4.2 p1

windows 10

xamp 3.3.0

 

thank you in advance

4 REPLIES 4

Re: CSS broken after changing server to client

Hello @Tsumiko ,

 

The user which is running command doesn't have enough access to it.

You can check the current user group by command : 

 

groups {USER}

now check the files group by command "ll", run it on your docroot.

 

now make sure the group you have added to the files is assigned to user who is running command.

also make sure the files permission in magento should have 644 and the folders should have 755, give permission by below commands :

cd <your Magento install dir>

// 644 permission for files
find . -type f -exec chmod 644 {} \;

// 755 permission for directory
find . -type d -exec chmod 755 {} \;

chmod 644 ./app/etc/*.xml

chown -R :<web server group> .

chmod u+x bin/magento

Hope it helps !

Thanks

Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy

Re: CSS broken after changing server to client

Hi

 

Thx for your answer but I"m using windows 10 not linux

Re: CSS broken after changing server to client

@Tsumiko 

 

Magento doesn't work perfectly fine in Windows though.

I believe it's only with permission,
give 777 permission to below folders before running the command :

var/

generated/

pub/static/

pub/media/

 

Hope it helps !

Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy

Re: CSS broken after changing server to client

I did a new install and this error not displayed again

thx