3
votes

I recently upgraded my Drupal core from 6.15 to 6.26. In the update process, I was asked to make a backup of all my files, then delete the entire Drupal installation from my server, and rebuild it using the supplied files. I then copied all relevant back-up files back to the server from my local machine. The problem I'm having now is that I get a "The directory is not writable" notification whenever I do any sort of action as an admin. Initially, I was getting the error that "sites/default/files" was not writable, but I fixed that, and I changed the permissions on every file in the installation to 755. Why am I getting this error, and how can I fix it?

5

5 Answers

5
votes

Although permissions may be set to 755, most likely the directory ownership is set to the wrong user.

3
votes

Just wanted to add this possibility, which fixed this issue for me after trying many things:

If you're running SELinux (like Fedora), you may have a "security context" issue on /sites/default or /sites/default/files. So even if you open it up using chmod 777 (not a good idea), you STILL get the permission issue.

the fix is (first cd to sites directory):

restorecon -rv default/

I ran this locally as root.

I don't pretend to be an expert on security contexts by any stretch, but Fedora documentation is here.

Hope that helps others avoid my headache!

0
votes

After finding the permissions problem, you'll probably want to go back and chmod 644 for all files, and 755 for directories (besides the upload folder) just to be safe.

0
votes

Drupal sometimes create some directories so check if sites/default/files sub directories have the right permissions

-1
votes

You can do it using two possible options:
1. change the owner of files directory and all files inside it to apache user
2. Give 777 permissions recursively to files directory