Skip to content

Instantly share code, notes, and snippets.

@maxyudin
Created September 3, 2022 09:12
Show Gist options
  • Save maxyudin/2ed4559561744eb057aacf2b1fe6b318 to your computer and use it in GitHub Desktop.
Save maxyudin/2ed4559561744eb057aacf2b1fe6b318 to your computer and use it in GitHub Desktop.
# Cheatsheet: correct file permissions for WordPress
# During the setup:
cd /wordpress-directory # Change directory
chown www-data:www-data -R * # Let Apache be owner
find . -type d -exec chmod 755 {} \; # Change directory permissions rwxr-xr-x
find . -type f -exec chmod 644 {} \; # Change file permissions rw-r--r--
# After the setup you should tighten the access rights:
chown <username>:<username> -R * # Let your useraccount be owner
chown www-data:www-data wp-content # Let apache be owner of wp-content
# Source (amended): https://stackoverflow.com/a/23755604/577418
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment