Images not appearing, won't rescan

Permalink
I'm getting this error on many of my images after I had to clean and restore my site:

Warning: imagejpeg() [function.imagejpeg]: Unable to open '/site/files/cache/399f055650de626a2035fd0a2dbf05f1.jpg' for writing: Permission denied in /site/updates/concrete5.5.2.1/concrete/helpers/image.php on line 173

I get a similar error when I try to rescan my images (although their thumbnails show in the File Manager just fine):

Warning: imagejpeg() [function.imagejpeg]: Unable to open '/site/files/thumbnails/6513/5422/7336/Survey_Map.jpg' for writing: Permission denied in /site/updates/concrete5.5.2.1/concrete/helpers/image.php on line 173

I've uploaded a clean image.php, manually deleted my cache (because I'm having trouble clearing the cache as well).

Any help is much appreciated.

AltaPlanning
 
adajad replied on at Permalink Reply
adajad
The 'Permission denied...' error leads me to think you have the wrong folder permissions on the 'files' folder (including subfolders). Make sure you have 755 permissions set.
AltaPlanning replied on at Permalink Reply
AltaPlanning
Thanks. I already had it at 755 but I guess all C5 stuff needs 777. That seems to unsecure to me and it takes to long to do recursive chmods back and forth, but I guess that's what you have to do. Ironic since I have to do all this stuff because the site got hacked...
JohntheFish replied on at Permalink Reply
JohntheFish
It all depends on how your server is setup. Ideally, Apache should 'own' the web space directories and files, and c5 execute under that ownership, so 755 will work fine.

I am sure there are some linux experts on here that can explain that better.
adajad replied on at Permalink Reply
adajad
Nope, not 777. That would be plain stupid (security wise)...

There is obviously something else going on here.

The first error is pointing to a cached file, but that file might be from your backup, right? Try to manually delete ALL files within 'public_html/files/cache', and also clear the site cache from the dashboard.

If that doesn't give you any results, then you could try to move the concrete folder out from updates/concrete5.5.2.1 and place it in your root (that is replace the one in there already). Then open up config/site.php and remove the last lines
?><?php define('DIRNAME_APP_UPDATED', 'concrete5.5.2.1');

Then go to 'yourdomain.com/index.php/tools/upgrade' and run the upgrade script again.

You have now made a manual upgrade (or actually reapplied the upgrade to 5.5.2.1). The difference now is that no scripts are called from the 'updates' folder.
AltaPlanning replied on at Permalink Reply
AltaPlanning
Hmm, I had tried your first suggestion, the manual cache clearing etc but not the second. I'll give that a shot if it comes up again.

Thanks!
mariojm1201 replied on at Permalink Reply
i have a similar problem in that i have used the following code. The hyperlink works however teh thumbnail image is only showing in editor but not the live site.

<div class="img"><a href="Gallery/L.M.S.S%20Ladies%20Dinner%202012/album/index.html"> <img src="Gallery/L.M.S.S%20Ladies%20Dinner%202012/album/folderthumb.jpg" alt="Klematis" width="200" height="150" /> </a>
<div class="desc">L.M.S.S Ladies Dinner 2012</div>
</div>