homepage Welcome to WebmasterWorld Guest from 54.163.72.86
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
ImageMagick suddenly stopped working on Linux shared hosting
coffeebaby




msg:4543221
 12:54 am on Feb 7, 2013 (gmt 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

 

phranque




msg:4543226
 1:13 am on Feb 7, 2013 (gmt 0)

welcome to WebmasterWorld, Amanda!

have you tried adding something like this?


use lib "/usr/bin/";

coffeebaby




msg:4543234
 1:46 am on Feb 7, 2013 (gmt 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;
}

phranque




msg:4543349
 10:33 am on Feb 7, 2013 (gmt 0)

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;".

SevenCubed




msg:4543461
 3:56 pm on Feb 7, 2013 (gmt 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.

coffeebaby




msg:4543501
 6:14 pm on Feb 7, 2013 (gmt 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?

SevenCubed




msg:4543517
 6:46 pm on Feb 7, 2013 (gmt 0)

Ah okay...raising my mug of Starbucks French dark roast java to you.

coffeebaby




msg:4543519
 6:56 pm on Feb 7, 2013 (gmt 0)

brewing a fresh cup as I type this lol

phranque




msg:4543616
 11:07 pm on Feb 7, 2013 (gmt 0)

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.

coffeebaby




msg:4543626
 11:26 pm on Feb 7, 2013 (gmt 0)

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved