Note about installing ImageMagick w/ mod_perl2 in Apache 2.2

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
User avatar
Randolf
Posts: 19
Joined: 2007-10-08T20:58:27-07:00
Location: Beautiful British Columbia, Canada

Note about installing ImageMagick w/ mod_perl2 in Apache 2.2

Post by Randolf »

I've been dealing with some strange errors after installing ImageMagick on a Windows XP Pro SP3 system running ModPerl 2, libapreq2, and Apache 2.2. The errors indicated that DynaLoader couldn't find ImageMagick's DLL file when using the LoadFile directive in the "httpd.conf" file. Here are two errors from Apache HTTPd's error log (the second error occurs when the "LoadFile" directive isn't used to pre-load ImageMagick's DLL file; time and other sensitive information was obscured as per privacy requirements):
[Mon Dec 14 18:38:58 2009] [error] Can't load 'C:/Perl/site/lib/auto/Image/Magick/Magick.dll' for module Image::Magick: load_file:The specified module could not be found at C:/Perl/lib/DynaLoader.pm line 201.\n at C:/internet/com/example/www/script.pl line 6\nCompilation failed in require at C:/internet/com/example/www/script.pl line 6.\nBEGIN failed--compilation aborted at C:/internet/com/example/www/script.pl line 6.\n

[Mon Dec 14 18:38:58 2009] [error] [client 10.88.88.88] Can't locate ModPerl/ROOT/ModPerl/Registry/C_3a_UNIQUE_NAME_2epl.pm in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib . C:/Program Files/Apache Software Foundation/Apache2.2) at C:/Perl/site/lib/Apache2/Reload.pm line 176.\n, referer: http://www.example.com/script.pl
The solution to this problem was to reboot Windows (stopping and starting the Apache 2.2 Windows service also didn't make a difference), even though the path wasn't altered. After rebooting, the ImageMagick-specific lines below didn't cause errors, and the script was compiled and executed successfully and consistently:
#
# Pre-loads for mod_perl2.
#
LoadFile "C:\Perl\site\lib\auto\Image\Magick\Magick.dll"
PerlModule Apache2::Reload
PerlModule Apache2::Request
PerlModule Image::Magick
PerlInitHandler Apache2::Reload
I hope this will be helpful information for anyone else who encounters this issue. Please note that this seems to be a Windows-specific problem as it doesn't occur on NetBSD (and I suspect this to not be a problem for all other flavours of Unix including Linux and MacOS as well).
Randolf Richardson - randolf@richardson.tw
Greater Vancouver Area, Beautiful British Columbia, Canada

"Petition to make all spam illegal in Canada:"
http://www.lumbercartel.ca/law/canada/s-220/
User avatar
Randolf
Posts: 19
Joined: 2007-10-08T20:58:27-07:00
Location: Beautiful British Columbia, Canada

Re: Note about installing ImageMagick w/ mod_perl2 in Apache 2.2

Post by Randolf »

One more thing: Make sure you manually download all Windows updates, including right up to the current Service Packs. To make sure you've got all the updates downloaded, keep going back into the Windows Updates system until there are none left to download -- in Windows XP the "Express" mode won't get everything, so you'll need to choose "Custom" and turn everything on (although you won't need the Windows Live stuff).
Post Reply