Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache folder permissions in PROD #358

Open
daninr opened this issue Mar 21, 2019 · 4 comments
Open

Cache folder permissions in PROD #358

daninr opened this issue Mar 21, 2019 · 4 comments

Comments

@daninr
Copy link

daninr commented Mar 21, 2019

Hello,

When I deploy my Symfony application to production server and try to cache clear, I receive the following error:

Failed to remove file "/project/var/cache/pro~/fosJsRouting/data.json": unlink(/project/var/cache/pro~/fosJsRouting/data.json): Permission denied.

If I see the permissions, I noticed cache folder has been created with user/group: www-data

How can I solve it?

@jfdl
Copy link

jfdl commented Mar 5, 2020

Hello,
I get the some permissions issue.
All files and folders under var/cache/prod are created with the site user owner (run) except fosJsRouting
which is created with www-data
fosJsRouting
How did you solve your issue ?
Using :

  • Symfony 4.4.5
  • FOSJsRoutingBundle : ^2.5
  • Ubuntu : 18.x

Thanks

@daninr
Copy link
Author

daninr commented Mar 5, 2020

Hello @jfdl,

Unfortunately I could not solve it. I removed this bundle and stopped using it.

@yuriang85
Copy link

Establecer todos los permisos a /symfony/var/cache/*
chmod -R 777 sysmfony/var/cache/

@xopino
Copy link

xopino commented Dec 19, 2023

Hi @yuriang85, setting files to mode 777 is almost never a good idea since it defeats any security.
Having the files under the owner www-data is a good option though.
The issue may be caused because the user wich is trying to access to that file is not www-data.

Did you try to remove cache using the user www-data?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants