We've recently had a few problems with our server, which seem to have been all patched up by myself, my host, and the cPanel team. However, since then we have been having problems with sites/default/files. The problems are happening on the active site running D6, and our dev site, running D7 in a subdirectory at the moment. I'm assuming the problems are related, so after I figure out how to fix one site, I'm sure it will be a similar fix for the other.
On the D7 site, when I save a piece of content, I get the message: The specified file temporary://filetLWqk4 could not be copied, because the destination directory is not properly configured
At admin/config/media/file-system, I'm seeing the error: The directory sites/default/files exists but is not writable and could not be made writable.
When clearing the cache, I get an error including: Warning: unlink(mysite/sites/default/files/js/wysiwyg/wysiwyg_tinymce_VxxRIlcaFmzHlghU8SsOGCZd5TC_PCxyhQAlqydMALE.js): Permission denied in drupal_unlink() (line 2197 of mysite/dev/includes/file.inc)
What I have read seems to indicate that this is the result of a permissions problem that people seem to have with some clean installs and server migrations. Neither of these cases apply to me, but I thought the solutions might. Most pages that I can find essentially recommend
chown -R www-data:www-data sites/default/files
and making sure that permissions are set to 755 or 775. I'm on centos, which uses apache
instead of www-data
, so I substituted it where appropriate, but I still have no luck.
I also just tried changing the permissions of sites/default/files
to 777, and I'm still getting the error that it couldn't be written to.
Any ideas?
chcon -R -t httpd_sys_rw_content_t sites/default/files