I am deploying Symfony to a web server, and once deployed I want to clear the cache. I am using a umask of 0000 for now to get around any potential permission issues (I am doing the clear under the deploument user and running the site under the apache user).
I am using /var/symfony/cache/projectname/branchname/environment
and /var/symfony/log/projectname/branchname/environment
as the dirs
to save the cache and logs. These are configured in the AppKernel.php
file.
When I deploy (using 'php bin/console cache:clear --env=prod --no-debug') I get a message that says:
[RuntimeException] Unable to create the logs directory ()
I have done a touch to create a file in the /var/symfony/log/ dir and it worked fine, so any idea why the cache clear command is failing?
We are using a sticky bit from the /var/symfony/
dir up to set permissions as drwxrws--t
so that when we do the cache clear as the deployment user, it can set user as apache and group as www with them both in the www group.