Community

problems with file permissions and IMCE in sites/default/files directory

I have looked around a great deal on the Drupal forum and elsewhere but I cannot yet resolve this.

I have had to reinstall a large, fully functional site (D7.18) onto a new server. This has gone very smoothly. However, I do not seem to be able to set permissions for my sites/default/files directory in a manner that keeps it accessible and safe when browsing using IMCE.

  • Usually I set sites/default/files (and subdirectories within it) as 755, with files within these directories as 664. This works well on many other Drupal 7 sites I have built.
  • HOWEVER in this case, with these permissions I get the message "Unable to get a working directory for the file browser".

Only by setting directory permissions as 777 can I browse the files in these directories using IMCE - and I know that is really BAD practice on shared hosting.

Please can someone advise on troubleshooting this? I have spent hours but I am getting nowhere.

I wonder if the ownership of the files and directories themselves is wrong. If they are wrong, can anyone direct me to step-by-step instructions for changing them?

  • Examining the 'problem' files and directories using FireFTP, I see that both user and group names are the same as the FTP username that was given me by my web host.
  • Looking at another Drupal site that works properly, I see that files and directories in sites/default/files are set to user 531/group 528.

Thanks in anticipation! I am running D7.18 on PHP 5.2.10 with extensions enabled. Everything else seems to be working very well indeed.

NB - is it possible that things would work better on PHP 5.3? I think this site was previously on a PHP 5.3 server.

Comments

sorry

I'm sorry to bump this, but please, does anyone have any suggestions on this problem?

I am fully aware this may be an Apache rather than a Drupal problem but I don't know how to take it forward, or how to discuss it (if necessary) with my hosting provider. I'm out of my depth! Thanks in anticipation to anyone who can make suggestions.

nobody click here