Hi.
I can't get Imagecache to work. Imagecache created the right folders but can't create the image. I tried setting all the folders (and) in files to 777 but still no success.

The only error i get in drupal is:

fopen(files/imagecache/main/files/images/images.jpg) [function.fopen]: failed to open stream: No such file or directory in /var/www/vhosts/example.com/httpdocs/includes/file.inc on line 562.

filesize() [function.filesize]: stat failed for files/imagecache/main/files/images/image.jpg in /var/www/vhosts/example.com/httpdocs/sites/all/modules/imagecache/imagecache.module on line 220.

mime_content_type(files/imagecache/main/files/images/image.jpg) [function.mime-content-type]: failed to open stream: No such file or directory in /var/www/vhosts/example.com/httpdocs/sites/all/modules/imagecache/imagecache.module on line 214.

The server is using PHP 5.1.6

Comments

techrobo’s picture

Check following:
1. Check permissions of your 'files' folder. 777 is required.
2. It should have folder imagecache/main. You can try creating these folders manually.
3. If these folder exists check the permissions, these should be 777.

This should resolve your problem.

UnicornSong’s picture

Hi. Same problem here. The image is not created in the relevent folder. .tmp files ARE being created in my files/sitename/tmp folder (i switched to /tmp to see if it helped - it did not)

I have set windows folder permissions to everyone/full control.

I have manually created imagecache/main folder (also given full control)

I have flushed my preset cache.

I am going bald with frustration (not a good look for a girly)

Looking forward to a resolution on this issue!

jillpadams’s picture

I know this comment is 5.5 years old, but: you should never ever ever set your perms to 777. This is a huge security loophole that can be exploited. You can set Files dir to 775 and adjust your file settings temp directory to tmp and it should work.

TheGreekGeek’s picture

/var/www/vhosts/example.com/httpdocs/sites/all/modules/imagecache/imagecache.module on line 214.

Did you change that or havent you configured it yet?

btw, have the same problem, except sometimes it works, sometimes it doesnt. Drives me crazy

detot’s picture

The problem where in the "File system" settings. The "Temporary directory" was set to "/tmp" and the web host didn't support to save, edit etc that deep. But just "tmp" worked, so the tmp file ended up i the same level as drupal.

jptaranto’s picture

Thanks so much. I tried and tried for about 6 hours to fix this damn problem.

I needed to se the tmp path to something inside files.... so now it reads sites/default.files/temp

All is working!! horay horay horay

cacaf8’s picture

Removing the / from the file system temporary directory fixed my imagecache problem.

jillpadams’s picture

This was it - thank you!

mcannell’s picture

I've done this, I've even changed "/tmp" to "tmp". Everything is set to 777. It still tries to put the thumbnail in "/files/imagecache/product/files/" unsuccessfully.

Just like everyone else, clicking the broken image opens the full size image in the box.

gearhead’s picture

I'm having the exact same issue.
Any new ideas?

Gear Head
www.musclecarsociety.com

timlie’s picture

I tried almost everything to get this to work but I'm still stuck. When I try to upload an image, the image is not shown in the preview, when i check my temp folder (files/tmp) i can see a *.tmp file there. When I complete the forms, submit the form, the image is put in the root of the files folder (and is removed from the temp folder). None of the imagecache folders is created and the images are not resized.

Summary:
I don't think it has something to do with permissions as the files/tmp folder was created by drupal.
The image gets uploaded to that tmp folder (*.tmp) but I can't see it in preview on the imagefield form.
The image gets replaced (after submitting) to the root of the files folder, no imagecache folders created.

The webserver is an IIS webserver, maybe something to do with that???

Can someone help please?
Thanx

timlie’s picture

Is has something to do with the ISAPI_Rewrite module.

Are there solutions for this?

http://www.lievenscomputerservice.be

UnicornSong’s picture

It might be worth it for you all to check that you have enabled a toolkit.

I enabled the ImageAPI GD2 module and now Imagecache works as I expected. I guess I must have missed the need for a toolkit to be installed when I RTFM'd

:o)

svihel’s picture

It seems that every time you change some settings in imagecache module something strange happen and drupal no longer can upload data to this changed presed. Only thing that works is delete whole directory imagecache in files and then create it back so the permissions are reset or something and then you have to return it back to 777. I guess something with the folder owner happens here, not sure what exactly though.
Is it bug in drupal (imagecache) or just in my server?

AlexBorsody’s picture

Permissions 755 should work fine don't need 777.

Also make sure you set up your tmp directory admin/settings/file-system here and set your permissions there as well.

Clear your browser and Drupal cache.