Page 1 of 1

Thumbnails and Images not displaying

Posted: 23 Jul 2009, 00:00
by jyates
Everything has been running smoothly for a couple of weeks, the galleries have been displaying fine, but when I checked it today it appears to be broken!?!? :(

The thumbs are not showing and I just get text:

Image

If you try clicking on a picture... it just says "Loading" and nothing happens... no lightbox etc:

Image

The thumbs are not showing in the Joomla Admin screens either:

Image

Image

The weird thing is that while the video gallery shows no thumbnails, if you click on the video to display it, the lightbox pops up and the video loads.

:x :x :idea:

I've checked the file permissions and noticed that thumbs are being "owned" by 'apache' (as opposed to 'airline' like everything else) and set with permissions 644. However, resetting ownership and changing permissions to 777 still doesnt help.

I'm beginning to think it is actually an issue with the webhosting... but everything else (including pics) on the website (http://60.234.41.197/~airline/) seems to be working OK.

Any ideas?

regards,
Jared

note: I also tried upgrading to 2.5.1 beta... but has made no difference :(

Re: Thumbnails and Images not displaying

Posted: 23 Jul 2009, 07:31
by jyates
UPDATE: It would appear that the issues were due to the site being 'hacked'...

And by hacked, I mean I had foolishly left some of the directory permissions set to 777. :oops:

This allowed the intruder to upload a .htaccess and a <random_number>.php (ie. 781244.php) file into each of the Phoca 'thumb' directories. None of the other directories on the site were affected.

The .htaccess file was attempting to redirect 404 errors to the .php file, which in turn was trying to redirect the user to some random website based in russia I think (i didnt really bother decoding all the base64 garbage)

For some reason, this .htaccess file was preventing access to anything contained in the same directory (direct linking to the files would generate a Server 500 error)... once I removed the .htaccess files, the Phoca galleries started working perfectly again.

The reason I had the directories set to 777, was that Phoca was unable to generate thumbnails with the permissions set to 755. I am unsure why this is... I think it is because Phoca seems to generate files that belong to (user/group) apache/apache, whereas all other files are airline/airline... so having 755 only gives write access to user airline, and Phoca can't write to the folder as apache.

Not sure what my options are here?

Do I chown the directories to belong to user 'airline' but group 'apache' and 775 the permissions? Will that still enable someone to upload these .htaccess files?

Can I set joomla and/or Phoca so that it can generate the thumbs and upload them via FTP (or some other method) using the 'airline' user so I can leave the permissions as 755?

any ideas? :idea:


regards,
Jared

Re: Thumbnails and Images not displaying

Posted: 23 Jul 2009, 18:28
by Jan
Hi, Phoca uses the File method from Joomla! so e.g. if Joomla! has activated FTP layer then it uses this ftp layer to create folder. But the folders are created with 777. It seems like I will change it to 755 or I will do parameter for it.

Jan

Re: Thumbnails and Images not displaying

Posted: 24 Jul 2009, 06:30
by jyates
Yeah... if I create a folder from within Phoca (New image, create folder)... it creates it as 755... this is created as user/group "airline/airline"...

but when it generates the thumb dir... that is created as 777 (as airline/airline)...

However, the thumbnails themselves are created as 644 and as user/group "apache/apache".

The problem I have now is that if I manually change the thumb dir permissions back to 755... Phoca cannot generate the thumbnails as it doesnt have permission!! :idea:

Re: Thumbnails and Images not displaying

Posted: 24 Jul 2009, 13:27
by Jan
Hi, now you can set the permissions of the folder (in parameters in version 2.5.2). The thumbnails are created by GD library so they get 644

If there is a 755 permission for folders and folders were created with help of ftp (ftp layer enabled in global configuration of Joomla!) then the ownership should be the same so it should be allowed to write thumbnails there.

Try to enable/disable ftp layer, check the ownership of folders :idea:

Re: Thumbnails and Images not displaying

Posted: 21 Aug 2009, 15:58
by ua_tester
I've got the same trouble while user uploading after user category creating: [usercategorydir]/thumbs is created with wrong access permissions.
(if first upload in this just created category was from admin backend all is ok)

Whould you tell me where in *.php is thumbs-dir creation? What should I fix -- I don't want fix it manually everytime?

PS. sorry for my terrible english.

Re: Thumbnails and Images not displaying

Posted: 21 Aug 2009, 23:33
by Jan
Hi, permissions or ownership on the server should be changed. As Phoca Gallery uses two methods to write thumbnails (server or ftp - with help of JFile method), you need to find Joomla! file methods, because they write the images on the server (if it is set in parameters)

You can see the thumbnails creating in:

administrator\components\com_phocagallery\libraries\phocagallery\image\imagemagic.php

Jan