Welcome to WebmasterWorld Guest from 54.162.232.51

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

ImageMagick suddenly stopped working on Linux shared hosting

     
12:54 am on Feb 7, 2013 (gmt 0)

New User

joined:Feb 7, 2013
posts: 5
votes: 0


I have a classified ad script running that's been using ImageMagick for several years now with no problem. suddenly several weeks ago it just stopped working. I have linux shared hosting with Godaddy.

The person who wrote the script (mojoscripts) has shut down their support desk. Godaddy keeps telling the same thing over and over (The convert path to ImageMagick, version 5 on our servers is: /usr/bin/ The convert path to ImageMagick, version 6 on our servers is: /usr/bin/convert)

When I shut off imagemagick through the admin panel everything works normally except the photos upload without thumbnails which destroys the ad layout. When I turn on image magick I get the following error whenever uploading photos:

Can't locate Image/Magick.pm in @INC (@INC contains: /home/content/...(shortened)...cgi/scripts/imagemagick.pl line 2.
BEGIN failed--compilation aborted at... (shortened)...cgi/scripts/imagemagick.pl line 2.

Line two in the script is: use Image::Magick;

Mojoscripts help section says "Did you verify with the host that BOTH image::magick module (perlmagick) AND image magick utilities and libraries are installed ? (your host pointing to a server module list where image magick is listed as installed module is not enough in this case, it does not prove that the perl module has been fully installed with all components)."

I did run a php script to see if image magick was detected... both versions were detected on Godaddy but I couldn't tell whether perlmagick was installed.

I asked Godaddy to check if perlmagick was somehow uninstalled but they just aren't inclined to do so.

So I'm totally at a standstill here... not sure what other course to take at this point. Hope somebody can help or at least point me in a new direction that I haven't tried yet.

thanks you for reading,
Amanda
1:13 am on Feb 7, 2013 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:10888
votes: 72


welcome to WebmasterWorld, Amanda!

have you tried adding something like this?

use lib "/usr/bin/";
1:46 am on Feb 7, 2013 (gmt 0)

New User

joined:Feb 7, 2013
posts: 5
votes: 0


thanks Phranque, that didn't seem to help but its possible I didn't change the correct file? There are two files for this script imagemagick.cgi and imagemagick.pl

Maybe if I show the first part of the code for imagemagick.pl it would help...

############################################################
sub CreateThumbnail{
use Image::Magick;;
my($final_thumb, $thumb, $t_width, $t_height);
my ($file, $width, $height) = @_;
#$width = $CONFIG{media_width} unless $width;
#$height = $CONFIG{media_height} unless $height;
$width = $CONFIG{media_width};
$height = $CONFIG{media_height};

($name, $ext) = &NameAndExt($file);
$path = &ParentDirectory($file);

$image = new Image::Magick;
$image->Read($file);
($orwidth,$orheight)=$image->Get('width','height');
if ($orwidth*$height>$orheight*$width)
{


and this is first part of the code for imagemagick.cgi

#!/usr/bin/
use Image::Magick;

###########################################################################
# imagemagick
###########################################################################


############################################################
eval {
($0=~ m,(.*)/[^/]+,) && unshift (@INC, "$1");
($0=~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1");
require "config.pl";
unshift(@INC, $CONFIG{script_path});
unshift(@INC, "$CONFIG{script_path}/scripts");
require "database.pl";
require "default_config.pl";
require "imagemagick.pl";
require "html.pl";
require "library.pl";
require "mojoscripts.pl";
require 'new_database.pl';
use CGI;
use CGI::Carp qw(fatalsToBrowser);
&main;
};

if ($@) {
print "content-type:text/html\n\n";
print "Error Including configuration file, Reason: $@";
exit;
}
10:33 am on Feb 7, 2013 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:10888
votes: 72


first make sure your module's subdirectory exists.
you should be able to find a directory named /usr/lib/Image/Magick/ - if you can't find an /Image/Magick/ subdirectory somewhere nothing you can do will fix this problem.
assuming this directory exists, you must either include /usr/lib/ in the perl library path environment variable or specify the library path using the "use lib" perl command in every script that invokes a "use Image::Magick;".
3:56 pm on Feb 7, 2013 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:June 14, 2010
posts:985
votes: 0


I know absolutely nothing about perl, nada, but it might be worth pointing out something here.

BEGIN failed--compilation aborted at... (shortened)...cgi/scripts/imagemagick.pl line 2.

Line two in the script is: use Image::Magick;

Maybe if I show the first part of the code for imagemagick.pl it would help...

############################################################
sub CreateThumbnail{
use Image::Magick;;

There is an extra semi-colon at the end of line 2 that you pasted.

I'm guessing it's too obvious to be the issue, must just be a typo when you pasted it here but just in case.
6:14 pm on Feb 7, 2013 (gmt 0)

New User

joined:Feb 7, 2013
posts: 5
votes: 0


@SevenCubed yes that was a typo on my part. didn't think anybody would notice so I didn't change it. very astute ;)

@Phranque I went into godaddy's CGI Admin and looked in the php modules list and I don't see imagemagick or perlmagick in there at all. I do see GD::Image. just in case I missed it, I did a "magick" search and got 0 results. so I guess until godaddy installs the module there's nothing i can do. Correct?
6:46 pm on Feb 7, 2013 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:June 14, 2010
posts:985
votes: 0


Ah okay...raising my mug of Starbucks French dark roast java to you.
6:56 pm on Feb 7, 2013 (gmt 0)

New User

joined:Feb 7, 2013
posts: 5
votes: 0


brewing a fresh cup as I type this lol
11:07 pm on Feb 7, 2013 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:10888
votes: 72


have you tried the "use lib" commmand in both the .pl and .cgi source files?

I went into godaddy's CGI Admin and looked in the php modules list

PHP and Perl are distinct environments.
11:26 pm on Feb 7, 2013 (gmt 0)

New User

joined:Feb 7, 2013
posts: 5
votes: 0


i most definitely meant to write perl.
i did try use lib on both actually.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members