Wrong permission of cache images

Zenphoto is able to create the cache images but is not able to display them. The cache folder has rwxrwxrwx permissions, the subfolders (albums) it creates get rwxr-x--x permissions and the thumbnails it creates get rw-r----- permissions. With these permissions, Zenphoto is not able to access it's own created images. When manually change the permissions to rw-r--r--, Zenphoto is able to read and display the images. So is Zenphoto running under a different user which is not the owner of the cache images after it creates them by itself? (..sounds stupid, I know :-) ..but obviously it looks like that to me.

Comments

  • It is most likely the web server that is running under a different user than the Zenphoto scripts. An unfortunate situation but sometimes is how servers get configured.
  • I removed (commented out) now the following lines from Zenphoto's "cacheImage()" function in functions-image.php script in order to keep the permissions of the created files to rw-r--r--

    line 484: @chmod($newfile, FILE_MOD);
    line 492: @chmod($newfile, FILE_MOD);
  • acrylian Administrator, Developer
    Hopefully you keep a note about your change as you will have to re-do it on any update. More info about permissions needed (basically what my colleague already said): http://www.zenphoto.org/news/permissions-for-zenphoto-files-and-folders
  • I suspect you will have additional permissions issues--for instance if Zenphoto uploades images. What you need to do is fix the chmod setting in your configuration file to something that works on your server.
  • Thx again for your suggestions, especially the last one. I reverted my changes to the functions-image.php and added the following line to my zenphoto.cfg instead:

    define('CHMOD_VALUE', 0644);

    This also solved the issue and I think with that I am "update-save".
Sign In or Register to comment.