Skip to content

Instantly share code, notes, and snippets.

@aaronott
Created October 17, 2012 20:37
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save aaronott/3908003 to your computer and use it in GitHub Desktop.
Fix D7 file permissions
#!/bin/sh
PERM_USER=nobody
PERM_GROUP=dev
APACHE_USER=apache
if [ $# -ne 1 ] ; then
echo "USAGE $0 <d7 root dir>"
exit;
fi
# set all files to 664 permissions
find $1 -type f -exec chmod 664 {} \;
# set all directories to 775 permissions
find $1 -type d -exec chmod 775 {} \;
# change owner to nobody and group to dev for everything in the webroot
# directory then change sites/default/files owner to apache
chown -R $PERM_USER:$PERM_GROUP $1; chown -R $APACHE_USER $1/sites/default/files;
@danomanion
Copy link

Wonderful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment