Skip to content

Instantly share code, notes, and snippets.

@pthurmond
Created August 28, 2023 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pthurmond/be5216c6f8ab09269de71b017323d798 to your computer and use it in GitHub Desktop.
Save pthurmond/be5216c6f8ab09269de71b017323d798 to your computer and use it in GitHub Desktop.

Drupal Permissions Setup

I am writing this in conjunction with the setup of a new Drupal 10 site on my local. The setup is a little different than the instructions call for because I am doing the setup within Lando. This means that the permissions didn't come out right and editing the site files directly on my machine leads to having read-only access.

Work done here is on Mac OS X 13.5 Ventura. But should apply to any Mac or Linux machine.

To resolve that, I did the following things after the initial site setup with composer within Lando:

  1. First, I checked the directory permissions. You can do that with stat -f '%A %N' *.
  2. That shows me the permissions in numerical format. All the files should be 644 and the directories be 755.
  3. Next, we need to correctly set the directory permissions. Go into the site root directory (where the "vendor" directory sites).
  4. Then set the correct directory permissions with: find . -type d -exec chmod 755 {} \;
  5. Now set the correct file permissions with: find . -type f -exec chmod 644 {} \;
  6. If these very quickly return then you likely need to run them with sudo at the beginning of the command to override existing permissions.

Thats it, your files and directories should now show the correct permissions.

References:

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