Skip to content

Instantly share code, notes, and snippets.

@KrustyHack
Created November 6, 2014 21:46
Show Gist options
  • Save KrustyHack/fb37b2f71437eb153252 to your computer and use it in GitHub Desktop.
Save KrustyHack/fb37b2f71437eb153252 to your computer and use it in GitHub Desktop.
Wordpress correct permissions
#!/bin/bash
if [ "$1" != "" ]; then
cd $1 && chown www-data:www-data -R *;
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
else
echo "Usage: sudo ./wordpress-permissions.sh WORDPRESS_PATH \n"
echo "Example: sudo ./wordpress-permissions.sh /home/test/mywordpress \n"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment