开发者

Drupal 7 file system error: The directory sites/default/files exists but is not writable and could not be made writable

I'm copying a Drupal 7 installation from one machine to another. Both machines are Mac OSX running current versions of MAMP. Procedure as follows:

  1. create sql dump file
  2. rsync -ar path/to/source path/to/destination
  3. chmod -R 755 destination/sites/default/files
  4. chown -R username dest开发者_StackOverflowination
  5. import sql dumpfile
  6. adjust settings.php (actually, they remain the same across environments, but just checking db connect info and $base_url.)

Everything works here, on the destination side, except that the sites/default/files directory can not be made writable[sic]. Something in the directory tree and/or permissions is changing, but I can't figure out what/how. What gives?


sites/default/files needs to be writable by the web user, or writable by all users.

all users:

chmod -R a+w destination/sites/default/files

or, make apache (or whoever your web user is) the owner

chown -R apache:apache destination/sites/default/files

Note: 755 and 777 sets everything as executable. 777 would have worked, it's just not proper. Executable permission is necessary for directories, but files generally should not be executable unless they need to be.

I personally prefer making apache the owner of the files directory and all the contents inside because that's what happens anyway when Drupal writes files.


Probably you need to run restorecon on the directory for eg:

restorecon -rv default/
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜