0

I get "The requested class did not generate properly, because the 'generated' directory permission is read-only" during setup:di:compile even though the folder has 777 permission.

I even tried with sudo, but I get the same error.

asked Dec 30, 2022 at 12:45

3 Answers 3

0

Try this command from CLI.

sudo chmod -R 777 var/ generated/

answered Dec 30, 2022 at 13:16
2
  • It is already set as 777, both var and generated. Commented Dec 30, 2022 at 13:47
  • Does that set properly? or it reset automatically when site is load on frontend? Commented Jan 2, 2023 at 10:03
0

Try below setps and check.

rm -rf pub/static/frontend/ pub/static/adminhtml/ var/{cache,composer_home,page_cache,view_preprocesseds,di} generated/*

sudo php bin/magento setup:upgrade

sudo php bin/magento setup:di:compile

sudo chmod -R 777 var/ generated/ pub/

Let me know if any query.

THANKS.

answered Dec 30, 2022 at 13:56
0
  1. Remove generated directory with the root user.

    sudo rm -rf generated

  2. Then switch to the Web server user (typically, it is www-data)

  3. Finally, compile code:

    bin/magento setup:di:compile

answered Dec 31, 2022 at 2:44

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.