Skip to content

Instantly share code, notes, and snippets.

@xeptore
Created November 16, 2017 04:53
Show Gist options
  • Save xeptore/56a022d30acd4219971a535f2acdd96a to your computer and use it in GitHub Desktop.
Save xeptore/56a022d30acd4219971a535f2acdd96a to your computer and use it in GitHub Desktop.
Symfony2.8 Directories and Files Permissions

Run these commands in your Symfony2.8 project base folder

HTTPDUSER=$(ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\  -f1)
setfacl -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs
setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs
find ./ -type d -exec chmod 755 {} \;
find ./ -type f -exec chmod 644 {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment