7

I am attempting to install Drupal on Linux Redhat using Apache, but it will not allow me to pass step 3 due to the fact that sites/default/files is not writable.

I have followed the instructions on Drupal.org, in their install.txt file as well as the instructions from others who have had the same error with no success.

I have granted permissions access all different ways, i.e.: root:root 777, root:apache 777.

I have also verified that Apache is the user running the Apache process, but I am still stuck.

Notes:

  • I have granted the user 'apache' 777 rights to the files folder with no luck.
  • I verified the user 'apache' is in fact the user running apache.
  • I was able to complete the installation of Drupal on Windows.

Any new ideas?

1
  • Does your Redhat installation have SELinux enabled?
    – dblue
    Commented Apr 3, 2015 at 22:57

4 Answers 4

5

I thought this would be a SElinux issue with security and I am a bit surprised that your solution worked.

For users with the "common" error, use the following command to provide apache with access despite SElinux security.

chcon -R -t httpd_sys_content_rw_t yoursite/sites/default/files/
2
  • 1
    O my god, in my 8 years of experience, this is the first example that happened on centos 7.2
    – qasimzee
    Commented Aug 28, 2016 at 14:16
  • 1
    CentOS 7.x user here. This did the trick! Thanks for posting. Commented Apr 18, 2017 at 17:52
2

Okay, so after following directions from both official and non-official web sources, the one thing that was never instructed to do or try was to reboot the application AFTER making permission changes to the files directory. I tried it, and this solved the issue.

This is weird because I've never had to reboot an OS after making permission changes on a directory. Additionally I did restart httpd after each change thinking that would be sufficient. Hopefully this can help anyone else running Redhat 7 with the same issue.

Thanks, TH

1

Have you checked to see if one the parent dirs of sites/default/files is restricting write access to Apache? That's my guess of what the problem is.

If you have sudoers access, you can use this command to test write access for the apache user when you're in the Drupal root directory:

sudo -u apache touch sites/default/files/test.txt
0

Likewise, this happened to me as well on redhat/Centos 7.3. Sys admining for years and NEVER have had to reboot for such an issue. I hope this helps someone else that's going crazy.

Drupal says sites/default/files is not writable but it really is.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.