1

I get this after executing php bin/magento setup:di:compile:

The directory "/home/x/y/generated/code/Magento" cannot be deleted Warning!rmdir(/home/x/y/generated/code/Magento): Directory not empty

0

This is because of bad permissions.

Execute this command as seen here

find var generated pub/static pub/media app/etc -type f -exec chmod g+w {} + &&
find var generated pub/static pub/media app/etc -type d -exec chmod g+ws {} +
2
  • anyone know how do these folders end up with bad permissions? these are all subfolders and files created by the system itself. – iphigenie Jun 10 '20 at 13:18
  • It can happen if someone is not logging in via ssh with the project user, but for example with root and then executing certain commands. Or if you have setup deployment in your IDE and picked the wrong user, e.g. root. – Black Jun 10 '20 at 13:20
0

This happens due to the folder does not have write permission. Go to your Magento root directory and run the below command

Try this:-

sudo chown -R www-data:www-data . 
1
  • anyone know how do these folders end up with bad permissions? these are all subfolders and files created by the system itself. – iphigenie Jun 10 '20 at 13:18

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.