0

I recently moved my website (Drupal 6) and database to a new server. I am now getting an error whenever I try to upload images using the image field. When I upload images the thumbnail doesn't appear and the error I get is:

"ImageMagick reported an error: libgomp: Thread creation failed: Resource temporarily unavailable"

I tried switching to using GD2 but this didn't make any difference. I've also checked that I have the correct temp folder set in the file system. I had migrated from a 1&1 hosting account to a newer 1&1 hosting account...

It seems like the ImageCache files are not being generated.

I'm not sure what to try next.

Any advice would be appreciated.

EDIT:

I also found that even inserting images that are already on the server into content are not showing up. The path is correct (I've checked the files) but they just don't appear.

Actually, hardly any images are showing at all throughout the website even though the paths are correct and when ImageCache is not even used.

2
  • Switching to GD2 can't give the same imagemagick error. You will need to elaborate with more information. Removing a line from .htaccess that clearly states that you should not remove it for security reasons is .. folly.
    – user7667
    Commented Jul 12, 2012 at 5:53
  • Hi coleopterist, thank you for your comment and pointing out about the error message for ImageMagick. You are right also about the security threat. However, it is at least working at the moment.
    – Ben
    Commented Jul 12, 2012 at 10:41

3 Answers 3

1

I found a solution to my problem. There were two changes I needed to make.

The first was in the .htaccess file in the "files" folder there was the line:

SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006

When I commented out this line I could see the images again.

However, I was still having problems generating new ImageCache images. I managed to fix this by adding the line below to the settings.php file:

putenv("MAGICK_THREAD_LIMIT=1"); 

I find out this last solution from my hosts (1&1) technical support.

3
  • I recommend putting that line SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 back in place. If a php script happened to get uploaded it would be executable in your files directory and that would be a bad thing.
    – mikeytown2
    Commented Sep 20, 2012 at 23:19
  • @mikeytown2 unfortunately often on shared hosting that Apache directive is disallowed. Do you know of any other way to avoid this issue? Commented Apr 3, 2013 at 10:07
  • putenv("MAGICK_THREAD_LIMIT=1"); I have put this thing at bottom of settings.php file and it worked for me. Thank you Commented Jun 24, 2013 at 12:29
0

The two most common problem are: 1. You don't have write access to the folder on the server where image cache will generate the image cache preset image files. If you are on shared hosting, go to control panel and set the permission accordingly. And if you have SSH access run the CHMOD for permissions. 777 can work.

And check the file system if the temp folder is correct and accessible to write files because that folder is being used to generate images.

3
  • Thanks for your reply. I've tried resetting the permissions and it hasn't made any difference.
    – Ben
    Commented May 17, 2012 at 13:50
  • Can you check the file system settings also? Check if the folder is getting generated. If not, then it has something to do with folder permissions. But if the folders are getting generated, then you know that it is some other error and then may be you need to check if GD2 is working and many more things.
    – Amitav Roy
    Commented May 17, 2012 at 17:22
  • Thanks Amitav, I'm still looking into it. I managed to resolve some of the problems by removing the code from the .htaccess file in the files folder. However, ImageCache is still not generating images.
    – Ben
    Commented May 18, 2012 at 11:09
0

I came across the same situation. I just checked file permissions of the images folder(sites/default/files) in my server. U can right click on the files folder and then choose file permissions (make sure WRITE and EXECUTE checkbox's are checked for group and public permissions).

And the problem for improper functioning of images may be a module issue. so try to re-install the image module. It may work. hope this is may help you

4
  • This is what Amitav Roy said in drupal.stackexchange.com/a/31429/4471
    – niksmac
    Commented May 18, 2012 at 5:02
  • ya but i particularly said about files folder permissions . That too i even faced similar situation . I just tried to explain how i solved it.
    – Ramaraju.d
    Commented May 18, 2012 at 5:35
  • When you do as you explained the process happens is drupal.stackexchange.com/a/31429/4471.
    – niksmac
    Commented May 18, 2012 at 5:47
  • Thanks for your responses. I have double checked the file permissions and they are all correct. I guess the next thing will be to try reinstalling the ImageMagick module. Will I need to reinstall ImageCache as well? I'm concerned I will lose all my generated images if I do this as well as my presets.
    – Ben
    Commented May 18, 2012 at 11:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.