php install help

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
imgrr

php install help

Post by imgrr »

I think I've installed image magic correctly but cant get an example to work. Looking at other threads here is what I have:


> convert -version
Version: ImageMagick 6.2.5 04/20/07 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2005 ImageMagick Studio LLC

[Yeah, I'm stuck with an older version]

> which convert
/usr/bin/convert

That all looks good. In PHP I've tried
<?php
if (extension_loaded('imagick')){ echo 'imagick';}
?>

and that does output 'imagick'. The problem is that in my code if I try the following it just hangs.
$image = new Imagic(); // or supplying an existing file name

Which is similar to examples over at http://php.net/manual/en/imagick.examples-1.php

The thing is I really want to avoid using exec in my code, but rubblewebs seemed to use exec in the examples I looked at. Any suggestions on what I need to do?
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: php install help

Post by Bonzo »

I have noticed this line is wrong as you have missed the K off imagick - is that just posting here or in your code ?

Code: Select all

// You have
$image = new Imagic(); // or supplying an existing file name

//Should be
$image = new Imagick(); // or supplying an existing file name
Some error reporting:

Code: Select all

try
{
IMAGICK CODE
}

catch(Exception $e)
{
        echo $e->getMessage();
}
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: php install help

Post by fmw42 »

I would be surprised if Imagick even worked well with such an old version of IM as 6.2.5. Perhaps you should check the minimum version of IM that is needed with Imagick.

The exec command in PHP is much more flexible and there is generally little loss of speed. see viewtopic.php?f=4&t=16779


But you will be stuck either way with the limitations and errors in IM 6.2.5 which is 300 versions behind.
imgrr

Re: php install help

Post by imgrr »

Thanks for the quick replys - I didn't have the notify box checked and didn't realize there were replys or I would have been here sooner.

I did leave off the k when retyping the Imagick() line, it was in the original code but good catch none the less.

About the version - I'll see if we can get a newer one installed. I'm limited by what is available in YAST on SUSE enterprise. Will talk to the server guy about that and try again once we get it upgraded.

Thanks gang!
Post Reply