Page 1 of 1

Unable to use Imagick in PHP

Posted: 2014-11-15T06:13:18-07:00
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

Re: Unable to use Imagick in PHP

Posted: 2014-11-15T06:37:01-07:00
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.

Re: Unable to use Imagick in PHP

Posted: 2014-11-15T06:49:52-07:00
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.

Re: Unable to use Imagick in PHP

Posted: 2014-11-15T08:45:29-07:00
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.

Re: Unable to use Imagick in PHP

Posted: 2014-11-15T10:08:47-07:00
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.

Re: Unable to use Imagick in PHP

Posted: 2014-11-15T10:12:45-07:00
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.

Re: Unable to use Imagick in PHP

Posted: 2014-11-15T11:07:07-07:00
by aks
I will check that out . Thanks for the tip