Setting permissions to 660 and 770 crashed the Site

I wanted to set the permissions properly, so I read the online user manual and set the file permissions in the albums to 660 and the folder permissions to 770, as recommended. At first my site didn't come up at all.

I changed permissions back to 777 folders and 755 files (some of the files are 644) and the ZenPhoto site is back but the Gallery albums aren't. Now I have this error message:

Zenphoto Error
MySQL Query ( SELECT COUNT(*) FROM `zp_comments` WHERE `type` IN ('images','_images') AND `inmoderation`=0 AND `private`=0 AND `ownerid`= ) failed. Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Backtrace:

in query (functions-db.php [101])
in query_single_row (class-image.php [660])
in _Image->getCommentCount (template-functions.php [2759])
in getCommentCount (indexpage.php [92])
in require (index.php [8])
in include (index.php [116])

Comments

  • I really don't know what to do about this. I suppose I could delete all the albums and upload them again, which would be ok. I kinda wish I knew what went wrong, though. I want to have the proper file permissions.

    On my other site where the Images folder needs to be set to 777, the tech guys suggested uploading an .htaccess file in all the images directories with this snippet of code in it. I think it's resolved some problems people were having, with hacking:

    `

    order allow,deny
    allow from all

    order allow,deny
    allow from none
    `
    You may add other extensions to that snippet. I'm thinking I might do this instead since changing the permissions hasn't worked out too good. But I need to get the site functional again before I can do this.
  • Yes, I deleted all the albums and uploaded a few of them again and everything is working ok now. I have too many albums/files to figure out which ones were causing the problems: so it was best to start over.

    What permissions are recommended for the albums, then?
  • 0755 for albums, 0644 for images. But if this does not work you may have to use the 0777 for everything.
  • Thank you. The online user manual may need to be updated with that info.
  • I have done that.
Sign In or Register to comment.