Image Magick, perl- Can't get working

Hi I just tried to install Image Magick to shrik some images, but I get the following error when I try to run my perl script?
Does anyone have any suggestions?

thank you

Can't load '/usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi/auto/Image/Magick/' for module Image::Magick: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.6/i386-linux-thread-multi/ line 230.
 at ./ line 4
Compilation failed in require at ./ line 4.
BEGIN failed--compilation aborted at ./ line 4.

------------------code below-------------------------------------------------

use strict;
use warnings;
use Image::Magick;  #this is the line the error occurs at

my $path = glob("./");

my @pageName = ();
opendir(DIR,$path) or die "can't open dir $!";
my @files = grep{/\.bmp|.JPG$/} readdir(DIR);

my $image = Image::Magick->new();  #contains an image
foreach $image_file (@files){

    $image->Resize(geometry => '120x90');
Who is Participating?

Improve company productivity with a Business Account.Sign Up

kblack05Connect With a Mentor Commented:

I believe this link is what you'll need...

This update can be installed with the 'yum' update program.  Use 'yum update
package-name' at the command line.  For more information, refer to 'Managing
Software with yum,' available at

yum imagemagick

If that installs for you, then run the perl -e commands again and see if you get the same error. Also useful is to open a second virtual terminal (ALT+F3 for example) and

tail -f /var/log/messages

Or even add this to the top of your perl script for some more verbose debugging.

Add the following snippet to your script, just beneath the shebang line (the first line of the script; usually !#/usr/local/bin/perl or !#/usr/bin/perl):

open (STDERR, ">/path/to/somewhere/error.txt");

then after you run the perl script, you should have verbose logging in

Post back if you have problems...
What operating system are you using? ( I know Linux but flavor)

Try this. From command line on the server type

perl -e 'use Image::Magick;'

If you run that command and it comes back with no errors, the module is working. If the module errors, then use this command to install it:

perl -MCPAN -e 'install Image::Magick'

If installing the module fails, it's likely a software package missing (which with the shared .so config error above seems likely). At this point you use the package manager for whatever distribution you have to install Image Magick. For example on a Mandriva box it would be

urpmi ImageMagick

Also, if you have installed them, and you are still getting errors from Perl, post back and I  can provide you with more information.


~K Black
sai4Author Commented:
hi K Black

perl -e 'use Image::Magick;'     gave me the same error

so I did
perl -MCPAN -e 'install Image::Magick'


Fetching with LWP:
Going to read /home/steve/.cpan/sources/modules/
Going to write /home/steve/.cpan/Metadata
Image::Magick is up to date.

I then tried

perl -e 'use Image::Magick;'   but it gave me  the same error

any suggestions?

Thank you

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Refer to previous post. You probably need to install core  components on the Operating System for ImageMagick. Which distro of Linux are you using? Then I can give you the steps to get it done.

sai4Author Commented:
Fedora Redhat 4

thank you
I think you have the API (application programing interface) for ImageMagick (aka PerlMagick) installed, but you don't have the application it interfaces with (ImageMagick) installed.

Dennis MaederCommented:
You have installed IM as a non-root user and your perl is looking in the standard root installed location - so it is not found when you run perl.
Dennis MaederCommented:
This link shows the way to do cpan install as non-root user.
Dennis MaederCommented:
On a different note, ImageMagick is not always compatible with system libraries, and you may do better using GD.
See e.g.
I would shell out to ImageMagick rather than perlMagic - this way you can test that all works well at the shell yourself rather than needing to wonder
to me it seems clear with this type of thing that one of the solutions is being used and that the questioner has just forgotten to mention it.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.