I'm having a similar problem to that described here when doing an upgrade from the 4.5.x version of the image.module to the 4.6.x. It may be a separate issue, but I noticed the error message I am seeing is the same.
There are similar errors mentioned in:
and also in:
However, in both cases PHP is operating in safe mode, which is not the case in mine. Safe mode is off.
In the second case they also affected the filesystem and upload.module, as well as the ability to create new images. The problem I am experiencing seems to be related only to the upgrade script, and accessing old images. Creating new images works. However, as there are many hundreds of images in the old site, recreating each gallery by hand would be quite an undertaking.
Here is the scenario:
SiteName runs on Drupal 4.5 in database SiteNameDB in /www/htdocs/drupal-45.
Its files are in the folder /www/htdocs/drupal-45/sitename_files, with images in the sitename_files/sitename_images subfolder.
I make a copy of the database, make a new settings.php file in the appropriate place, and copy the entire sitename_files folder to the /www/htdocs/drupal-46 folder.
I run the upgrade script. No errors, and now the site appears to be functioning.
As other users had reported problems with paths on the image module, I checked the paths in admin/settings and admin/settings/image.
The file paths in the image module settings appear to be different than before; whereas before they were specified relative to the drupal document root, now they are relative to the files directory specified in admin/settings. That's fine by me, except that it appears to prepend that path when doing the upgrade.
So now in admin/settings image, the image path is set as:
sitename_files/sitename_images
Where it says this path is relative to the files directory. Naturally, this doesn't work, so I correct it to:
sitename_images
I check that this directory exists, and is writeable. The settings page reports no error.
So I run the update-image.php script. It runs for awhile, and produces no output.
I go back to the admin/settings/image page, and at the top it displays the same error mentioned earlier in this issue:
File copy failed: source file does not exist.
No error messages appear in the log.
I've tried several variations on this procedure, each time dumping the db and the copy of sitename_files and reverting to a working original.
I've tried leaving the file paths as they are after the upgrade. I've tried specifying new paths for sitename_files and sitename_images (making new, empty folders instead of using the same folder from the drupal 4.5 site).
Each time, the result is the same. Galleries display thumbnails, but the full size images do not load.
The path to the image file is always munged, like so:
<img src="/sitename_files/Z/_name_images/sitename_image_XXX">
Z in this case seems to be a random selection of characters from the path sitename_images and XXX is a three-digit integer.
Inside the sitename_images folder, there are all the original images and thumbnails, plus a large number of new files, with filenames sitename_images_XXX where XXX is a three-digit integer.
All of these files are only 512 bytes in length; and the error message seems to indicate that the files were created, but are empty because the original (source file) could not be found. However, that is difficult to understand as those files are in the same folder and are readable.
If I try to open the image in a new window, and correct the munged file path, I do not get an image, but instead a plain text file that seems to contain again the munged image path and some other random characters, and portions of the original filename of the image:
„M.Gg;..…Mold_image_pathÀ=Vother_folder_in_sitename_files]Xpictures_Xsitename_images`X”tmp
The site is running on PHP 4.3.11 (again, safe mode is off) which I believe should be current enough for Drupal 4.6, and under Drupal 4.5 there are no significant problems.
The only other configuration issue I can think of is that PCRE does not have UTF-8 support enabled, so the search.module does not work.
Does the image upgrade script also require PCRE to have support for UTF-8 enabled?
Comments
Comment #1
dmjossel commentedI've reinstalled PCRE with UTF-8 support. The search module now works, but the update-image.php script still produces the same result.
Isn't anyone else having this problem?
Comment #2
bomarmonk commentedI am having the same problem with all files, including images. Did you find a solution? I've set up drupal three or four times and never experienced this, so I'm thinking it might be related to some strange apache or php settings that my shared host is using. Safe-mode is off, but could there be something else in the mix that causes this?
Comment #3
robson9776 commentedI got same error, and it makes me desperate. I try to re-install all from beginning, all drupal files on /var/www/ and image-4.6.0 module on /var/www/modules/image/
I hope with this new install I got diferent result, but when I try to upload a file that error comes again. which makes me so bad is when I saw there's nothing clue in this forum. Poor module...
ANYBODY who has this success stories please kindly submit some comment so that we all can work with image module... thanks!
Comment #4
dpw commentedI was having (what I think is) the same problem. It was telling me file not found... Looking in the /tmp directory, all my images had .txt extensions. It has taken me two days to resolve this, but I think I have it licked.
Check this thead out. It talks about MIME issues:
http://drupal.org/node/43568
Near the bottom, jonathan_hunt suggested installing the PECL fileinfo extension:
This site helped me install the extension:
http://www.jellyandcustard.com/2006/01/19/installing-pecl-modules/
Took me a while to configure it. Didn't seem to like my magic file, no matter which one I specifed (apache's or others).
I took the path out, and it worked!
$info = new finfo(FILEINFO_MIME);
$file->filemime = $info->file($file->filepath);
Oh, I am running PHP5 on Breezy...
I can now upload images and avatars, both of which I couldn't do before this change.
Comment #5
dmjossel commentedI think that's a separate issue. On fresh installations of 4.6.x, I can upload files and images without a problem.
The problem is that the image-update.php script is producing "file copy failed" errors, even when all the paths and permissions seem to be correct.
Another thread indicated that Drupal was creating file paths with permissions 740. Even when I change that, it makes no difference. Even with all image files and folders with permissions 777, it claims the file does not exist.
Comment #6
drewish commentedThis version is no longer supported. If this issue is occurring with a more recent version please open a new issue.