FriendsOfSymfony / FOSJsRoutingBundle

A pretty nice way to expose your Symfony routing to client applications.
1.48k stars 261 forks source link

Cache folder permissions in PROD #358

Open daninr opened 5 years ago

daninr commented 5 years ago

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 commented 4 years ago

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 :

Thanks

daninr commented 4 years ago

Hello @jfdl,

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

yuriang85 commented 1 year ago

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

xopino commented 8 months ago

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?