Recently I started building some sites with Drupal, one of which is an online store using Ubercart. Everything worked great at first, but after upgrading a couple of modules some images in the catalog were not being displayed properly. After upgrading imagecache (5.x-1.7 to 5.x-2.3) and imagefield (5.x-2.1 to 5.x-2.4), taxonomy images stopped appearing in the catalog categories and the smaller thumbnails stopped appearing in the product pages.
It turned out to be a problem with permissions on the files/imagecache/uc_thumbnail directory. The permissions were “rwx——”. I changed them to “rwxrwxr-x”, same as the other imagecache directories. That fixes the problem, temporarily. The next time a preset is changed or has it’s cache flushed, the directory for that preset will get deleted and recreated with the incorrect permissions.
The issue of the directories getting created with incorrect permissions is actually a bug in the imagecache module. It is reported to be fixed in CVS, but other users are apparently still having the problem even with the CVS version. In either case, the bug has not been fixed in the latest 5.x release.
I had basically the same issue with the imageassist module. Thankfully that has been fixed. This would not be an issue if I could change the umask that Apache uses (Apache 2.2.6 on FreeBSD 7). Unfortunately what little documentation I have found on the subject has been sparse and I have not been able to find anything that works. If I can find out how, I’ll post it. For now I’m stuck changing the permissions on the imagecache directories any time I update the presets or clear the cache.
Update: Durr… I’d been changing the umask in Apache in a variety of different ways, but that doesn’t do any good if you’re using suPHP. That runs with it’s own umask, which apparently defaults to 077. I needed to change the umask to 022 by editing suphp.conf. I still think Drupal modules should set the appropriate permissions on files that they create, but at least the problem can easily be solved by changing the umask.
Feb 17
Leave a Comment