I have a problem with a web application and its cache directory (I'm using symfony)
This cache directory is populated by the www-data user when visiting the application pages. The cache can also be populated or deleted executing some commands from console.
The problem is I use this machine for development and I need to access via web, and flush caches, create new models, etc via console.
Currently I have 777 permissions to make it writable by anyone. If I browse a page (and the cache is generated) I can't, for example, create a new model because I don't have permissions to alter the files generated by www-data. I must use sudo. But then, the files have root permissions and can't be written by apache, and the page crashes...
How can I make this directory (and its dinamically-generated contents) writable by both users?
Thank you very much.