Pregunta

I am upgrading Magento 2, and all Readiness checks are passed after giving 777 permission to pub/meda, generated folder. But during upgrade process it stops throwing error of non-writeable folder for the same folders that I provided them permissions before upgrade starts. Infact, readiness check is not passed without these permissions. Then again I provide permissions and after some time it requires again permissions.

Can we give the permissions once until the upgrade process gets complete..

I am upgrading on local server. Using Docker Image for community edition and upgrading for enterprise edition.

Here is the command that I use for writeable conditions exactly:

chmod -R 777 /var/www/html/generated/

¿Fue útil?

Solución

Please run these commands and check

Execute these commands as a root user. If you have already given 777 permission revert it using the first two commands else proceed with the rest.

find . -type f -exec chmod 664 {} \;

find . -type d -exec chmod 775 {} \;

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 {} +

Set the ownership to Magento user and web user using

sudo chown -R <Magento user>:<web server group> .

Running these commands sets the permission for folders and files in Magento root and for the new files to be created in var, pub, and generated directories.

Don't run any command as root user as it might cause the new static files to be created with root ownership which might prevent web user to access such files forcing you to provide 777 permission. Please, in any case, don't give 777 permission if so please revert it back. So run Magento commands as Magento user.

Otros consejos

try this commands and this will help you to allow permission to your project folders

sudo chmod -R 777 pub/* var/* generated/*
Licenciado bajo: CC-BY-SA con atribución
No afiliado a magento.stackexchange
scroll top