Unable to use Imagick in PHP

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
aks
Posts: 4
Joined: 2014-11-15T06:04:06-07:00
Authentication code: 6789

Unable to use Imagick in PHP

Post by aks »

Hi,
I "think" I was able to successfully install Imagick in my local xampp installation .

PHP V: 5.3.8
Apache 2.2.21
Windows Vista
I also installed imagick software in c:\ImageMagick folder, copied DLLs from core to the main location and set the right home path.

I am able to see the loaded imagick module in PHPINFO
I am also able to see Imagick formats = 202
I am also able to convert the images with command line from one format to another.

Its only when I use a PHP script, I get this error
Fatal error: Uncaught exception 'ImagickException' with message 'unable to load module `C:\ImageMagick\IM_MOD_RL_JPEG_.dll' in C:\xampp\htdocs\test\mycard\jq\export.php on line 13
and
ImagickException: unable to load module `C:\ImageMagick\IM_MOD_RL_JPEG_.dll': The specified procedure could not be found. @ error/module.c/OpenModule/1277 in C:\xampp\htdocs\test\mycard\jq\export.php on line 13

Here is the code

Code: Select all

<?php
$im = new Imagick();
$im->readImage(dirname(__FILE__) . '/a.jpg');
$im->thumbnailImage(150, null);
$im->writeImage(dirname(__FILE__) . '/thumb.png');
$im->destroy();	
?>
Can someone please help me and let me know what needs to be done additionally to get the PHP going ? Thanks
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Unable to use Imagick in PHP

Post by Bonzo »

Other people have had problems with Imagick; try searching the forum as there was a thread with an answer a little while ago.
aks
Posts: 4
Joined: 2014-11-15T06:04:06-07:00
Authentication code: 6789

Re: Unable to use Imagick in PHP

Post by aks »

Thanks Bonzo, I searched with Google and also in this forum but I could not find any solution. That is why I am looking for any pointer.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Unable to use Imagick in PHP

Post by Bonzo »

If you have uncomentd the Imagick option in the php.ini which I assume you have you have the wrong combination of php, Imagemagick and imagick.dll

I have found it is a bit hit and miss getting the correct combination.
aks
Posts: 4
Joined: 2014-11-15T06:04:06-07:00
Authentication code: 6789

Re: Unable to use Imagick in PHP

Post by aks »

I have done that and I think I got ahead to a good extent . But I don't think I can test out all variations. I will try something else. Thanks for your replies.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Unable to use Imagick in PHP

Post by Bonzo »

I use php exec( ) as I get feed up that every time I upgrade my XAMPP installation I have to mess about trying to get Imagick to work again.
aks
Posts: 4
Joined: 2014-11-15T06:04:06-07:00
Authentication code: 6789

Re: Unable to use Imagick in PHP

Post by aks »

I will check that out . Thanks for the tip
Post Reply