Posted by marcvangend on April 16, 2009 at 12:28pm
Jump to:
| Project: | ImageCache |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
After adding a new image ('testimage.jpg', using imagefield) to a node, I get a warning on a view which is supposed to contain the 'thumb' preset of this image:
warning: touch() [function.touch]: Unable to create file tmp/thumbtestimage.jpg because No such file or directory in /htdocs/drupal/sites/all/modules/imagecache/imagecache.module on line 417.The first thing I noticed, is that there seems to be a slash missing in
tmp/thumb_imagetestimage.jpg. I changed line 410 to $lockfile = file_directory_temp() .'/'. $preset['presetname'] .'/'. basename($src); and it seems to solve the problem. I will do some more testing but I guess that slash should be fixed anyway.
| Attachment | Size |
|---|---|
| imagecache_lockfilepath.patch | 678 bytes |
Comments
#1
Sorry, forget about the patch. It didn't solve the problem after all :-\
This means that I'm stuck with an error I don't understand... The derived images are generated correctly, but the generation of a scaled images causes the error. The error is only shown on the next page, probably because the messages have already been rendered by the time the error is caused. I'm on a windows machine (so folder permissions cannot be the problem) but my colleague with an OSX system gets the same behavior.
#2
not sure exactly but i'd check that you've got a valid temporary directory set for drupal's files settings.
#3
The temporary directory is set correctly, I already checked that.
As far as I'm concerned this isn't fixed yet, but I will leave it fixed for now. If the problem persists after moving the site to a remote server, I will reopen this issue.
Andrew, thanks so far.
#4
Automatically closed -- issue fixed for 2 weeks with no activity.
#5
This is caused by Drupal looking for a file directory that does not exist.
You have to create a file directory other than the default temp.
Under file system, override the default settings and type something like /temp.
The default settings has mamp included in the directory. This is O.K. if that's what you're using but not otherwise.
Besides, it's best to choose where you want these files.
#6
I am having this problem as well, on a local, Windows based, XAMPP installation.
@ MrPhilbert - could you please explain
1) What file directory do I have to create, i.e. where should it be located
2) Since the error message refers to the directory called /tmp, should it not be called /tmp, instead of /temp like you suggest?
3) How would one choose where you want these files?
Thanks!
#7
Confirmed on Drupal 6 and imagecache's latest version, on WAMP server (PHP 5.2.0, Apache 2.2.11, MySQL 5.1.36). Creating drupal/tmp directory seems to fix the problem for me... something's really wrong here....
#8
Thank you! that worked for me also.. im running WAMP server 2.0.. creating a directory called "tmp" in the installation of drupal seemed to fix the problem..
#9
I'm also struggling to get this to work. Did you find out what directory to create in the end? It works fine for me on my production server but I just can't get it to work on my local host.
#10
This was an issue of mine as well. I fixed it by creating a folder in my sites/default/files/ directory called 'tmp'. Then I changed the file system path in the File System settings to read this new directory. The error was caused by the process I took of creating the drupal site on a localhost then transferring the database and settings to a live server. It kept the file system path of my localhost.
#11
For me changing the file_directory_temp in the
drupal database -> variables ->file_directory_temp
did it some minor problems afterwards with the temp permissions (changed them to 777 and then back to 755 and they are ok now)
if you change the file_directory_temp variable you have to change also the XX part of the example below to the corect string length in this case its 5
s:XX:"string";
#12
#11 Solved the problem from me.
My default temp directory was set to "c:/wamp/tmp" I'm assuming because I installed Drupal locally first. Changing it to a relative path within the site ( ie. sites/default/tmp ) fixed the problem.
#13
#14
Automatically closed -- issue fixed for 2 weeks with no activity.
#15
Thanks Vahalaman and mprokolo - this was exactly my problem. I moved the site from a local WAMP installation to a development server and the temp directory was still set to local.