Page 1 of 1

installing imagick with the latest version of ImageMagick

Posted: 2013-03-01T11:51:09-07:00
by jjbaranowski
Hello,

I ran into something and I thought I might share it here. I installed the latest version of ImageMagick-6.8.3-6 on my Centos 6.3 server from an RPM I made from source. I also installed the ImageMagick-devel-6.8.3-6 as well because this is needed for imagick to install.

Next, I run the command "pecl install imagick" (as I always do) and this time I get an error: checking for MagickWand h header file configure error Cannot locate header file MagickWand h imagick

I thought that was strange so I searched for the file:
find / -name MagickWand.h
/usr/include/ImageMagick-6.8/wand/MagickWand.h

I dug a bit more into the installation files of imagick and found a check to see if it could find the MagickWand.h file and if it doesn't it's instructed to fail the installation. The check is looking for: $WAND_DIR/include/ImageMagick/wand/

My $WAND_DIR is /usr in my case but I noticed that the installation name of the newer version of ImageMagick now contain the version number in it (starting somewhere with version 6.8.0). imagick has it hard coded in their installation as $WAND_DIR/include/ImageMagick/wand/.

Does anyone know what the best way to fix this problem? I know someone else manages the installation of imagick but is there away to install ImageMagick into a folder without the version number on it so the pecl install imagick will find it properly?

Let me know your thoughts.

-John Baranowski

Re: installing imagick with the latest version of ImageMagic

Posted: 2013-03-01T12:45:48-07:00
by magick

Re: installing imagick with the latest version of ImageMagic

Posted: 2013-03-01T13:58:52-07:00
by jjbaranowski
Hello,

Ok, great post to let me know that you are aware of what I found but I still don't know what to do with it. That post doesn't guide me in anyway. Can you give me some more guidance to how to get the imagick to install? How do I use the *-config files to help me get this done?

Thanks in advance!

Sincerely,

John Baranowski

Re: installing imagick with the latest version of ImageMagic

Posted: 2013-03-03T05:58:23-07:00
by nikita
Hello, jjbaranowski. I solved this, installing older imagemagick release. http://sourceforge.net/projects/imagema ... es/6.x/6.7. and installing pecl imagick from source http://pecl.php.net/get/imagick-2.3.0.tgz (old release)

Re: installing imagick with the latest version of ImageMagic

Posted: 2013-03-03T12:50:09-07:00
by jjbaranowski
Thanks for your help. I guess I could choose to go backwards installing the old version but the point of this post was to help me and anyone else who wants to move forward and get the newest version of ImageMagick-6.8.3 installed on centos 6.3 with Imagick as well. Any help would be greatly appreciated to accomplish this.

Thanks,

John Baranowski

Re: installing imagick with the latest version of ImageMagic

Posted: 2013-03-03T13:29:04-07:00
by fmw42
Did you try the latest version of Imagick? See http://pecl.php.net/package/imagick/3.1.0RC2

Re: installing imagick with the latest version of ImageMagic

Posted: 2013-03-04T10:10:19-07:00
by jjbaranowski
Hello,

Thanks for the reply. I downloaded the latest version from your link up above and extracted it. I type phpize in the extracted folder. I checked the file "config.m4" which it created and found the hard coded folder as well.

if test -r $WAND_DIR/include/ImageMagick/wand/MagickWand.h; then
AC_MSG_RESULT(found in $WAND_DIR/include/ImageMagick/wand/MagickWand.h)
else
AC_MSG_ERROR(Cannot locate header file MagickWand.h)

with the latest version of ImageMagick, the folders look like this:

$WAND_DIR/include/ImageMagick-6.8/wand/

Do you think I could just edit this file and change it? Where is it picking this folder up from when I type phpize? That's when the file (config.m4) gets created. It must be picking that up from somewhere.

Let me know your thoughts.

-John

Re: installing imagick with the latest version of ImageMagic

Posted: 2013-03-04T10:31:09-07:00
by fmw42
Sorry I know little about Imagick or how to install it.

Re: installing imagick with the latest version of ImageMagic

Posted: 2013-03-04T16:28:20-07:00
by jjbaranowski
Hello,

I got the latest version of Imagick installed with the latest version of ImageMagick-6.8.3-7. Here is what I did:

Downloaded the latest version of Imagick (http://pecl.php.net/package/imagick/3.1.0RC2).
tar xvf imagick-3.1.0RC2.tgz
cd imagick-3.1.0RC2
next edit the file config.m4. On line 55 you will find the line:

"if test -r $WAND_DIR/include/ImageMagick/wand/MagickWand.h; then"

You will notice that the /ImageMagick/ is hard coded in the path. If you have installed a newer version of ImageMagick-6.8.X you will notice that the directory now is /ImageMagick-6.8/. I had to modify this line as follows:

"if test -r $WAND_DIR/include/ImageMagick-6.8/wand/MagickWand.h; then"

Next, I ran the command "phpize". Note if you already ran this command before fixing the file above, make sure you run "phpize --clean" first. Then re-run "phpize".

./configure
make
make install
service httpd restart


I hope this helps someone!

Sincerely,

John Baranowski

Re: installing imagick with the latest version of ImageMagic

Posted: 2013-03-04T18:25:23-07:00
by jjbaranowski
Hello,

Don't forget to add the line below to your /etc/php.ini file

extension=imagick.so

Then reload the httpd service
service httpd restart

Re: installing imagick with the latest version of ImageMagic

Posted: 2013-03-10T01:55:44-07:00
by broucaries
Please report upstream to use pkgconfig instead of hard coding path

Thanks

PS: we will made a patch in a few week on the debian side if not