Skip to content

Instantly share code, notes, and snippets.

@davidlonjon
Forked from lajlev/wp-file-permissions.md
Last active August 29, 2015 14:07
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 davidlonjon/a722201c2439c605700e to your computer and use it in GitHub Desktop.
Save davidlonjon/a722201c2439c605700e to your computer and use it in GitHub Desktop.

Set Wordpress file permissions and FS method on localhost

On Mac OS X (Leopard), the Apache HTTP Server runs under the user account, _www which belongs to the group _www. To allow WordPress to configure wp-config.php during installation, update files during upgrades, and update the .htaccess file for pretty permalinks, give the server write permission on the files.

One way to do this is to change the owner of the wordpress directory and its contents to _www. Keep the group as staff, a group to which your user account belongs and give write permissions to the group.

Step 1

$ cd /<wherever>/Sites/<thesite>
$ sudo chown -R _www wordpress
$ sudo chmod -R g+w wordpress

This way, the WordPress directories have a permission level of 775 and files have a permission level of 664. No file nor directory is world-writeable.

Step 2

Add this to your wp-config.php

define('FS_METHOD', 'direct');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment