Cannot locate header file MagickWand.h during imagick configuring

Tux

New member
Joined
Mar 18, 2013
Messages
7
I'm trying to install ImageMagick and imagick on my Centos 6.3 box. This box is running directadmin, hence I thought this might be a good place to start.

I've searched on google for an hour or so, and I can't really find anything that solves this.

# Wand-config --version
6.8.3 Q16
]# convert --version

Version: ImageMagick 6.8.3-9 2013-03-14 Q16 http://www.imagemagick.org

Kernel 2.6.18-238.19.1.el5

I have installed this ImageMagick the following way:
# yum install ImageMagick.x86_64 ImageMagick-devel.x86_64

I've also tried it without the x86_64 on the end, and it installed both (also i386). But the problem still occured.

When I download imagick from source 3.0.1 (stable), untar it, use phpize and then configure I get the following error:

checking for MagickWand.h header file... configure: error: Cannot locate header file MagickWand.h

If I use pecl (pecl install imagick) I get the same error as well.

Strangely enough, MagickWand.h is on my system. It's in 2 directories:

/usr/include/wand/MagickWand.h
/usr/local/include/wand/MagickWand.h

I have found this:
http://serverfault.com/questions/484850/installing-imagick-php-extension-on-centos-6-3-64bit

But I couldn't solve my problem with that information.

I hope one of you guys recognizes this problem and give me some pointers
 

Tux

New member
Joined
Mar 18, 2013
Messages
7
I have not seen your error before. However, if you like to try to install from source again, then I have made a how-to here: http://forum.directadmin.com/showthread.php?t=44449 - I have updated the guide every time theres been needed changes, and it works very well for me on CentOS 6.4 64bit.
Thanks for you reply, I'm trying it out now.

Did you notice imagemagick's version has been changed ? Your tut uses 6.7.9-2 but there's a newer one out there.

I'll let you know if it works.
 

Tux

New member
Joined
Mar 18, 2013
Messages
7
I have not seen your error before. However, if you like to try to install from source again, then I have made a how-to here: http://forum.directadmin.com/showthread.php?t=44449 - I have updated the guide every time theres been needed changes, and it works very well for me on CentOS 6.4 64bit.
Your tutorial didn't work. I stumbled upon the same problem again.

I also needed to modify a small part of your tutorial. I needed to change the imagemagick version to the newest, but also the imagemagick-devel.x86_64 wasn't hosted so I needed to pick http://www.imagemagick.org/download/linux/CentOS/i386/ImageMagick-devel-6.8.3-10.i386.rpm .

http://www.imagemagick.org/download/linux/CentOS/x86_64/ as you can see here.

I hope you have some advice for me
 

chronic

Verified User
Joined
Dec 14, 2006
Messages
53
I confirm that I have the exact same problem.
I hope someone can help me too.
 

bluebirdnet

Verified User
Joined
Feb 3, 2010
Messages
123
Location
Canada
I am having the same issues, on CentOS.

following Ditto's guide, stuck at step 5 with "make" command.


checking for MagickWand.h header file... configure: error: Cannot locate header file MagickWand.h
[root@cp1 imagick-3.1.0RC2]# make
make: *** No targets specified and no makefile found. Stop.
 

bluebirdnet

Verified User
Joined
Feb 3, 2010
Messages
123
Location
Canada
Tux

I fixed the issue. Its invalid path in configure.

In my case my ImageMagick.h file was located in /usr/local/include/ImageMagick-6/wand/

so i created a symbolic link to the path since its looking for /ImageMagick with no "-6"

ln -s /usr/local/include/ImageMagick-6 /usr/local/include/ImageMagick

bingo! configure works....
 

bluebirdnet

Verified User
Joined
Feb 3, 2010
Messages
123
Location
Canada
An other issue i resolved.

/usr/local/bin/identify -list configure
/usr/local/bin/identify: error while loading shared libraries: libMagickCore-6.Q16.so.1: cannot open shared object file: No such file or directory

fixed with ldconfig /usr/local/lib

then running it again

/usr/local/bin/identify -list configure

Path: /usr/local/lib/ImageMagick-6.8.3//config-Q16/configure.xml

Name Value
-------------------------------------------------------------------------------
CC gcc -std=gnu99 -std=gnu99
CFLAGS -I/usr/include/freetype2 -fopenmp -g -O2 -Wall -pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
CODER_PATH /usr/local/lib/ImageMagick-6.8.3/modules-Q16/coders
CONFIGURE ./configure '--with-perl=/usr/bin/perl'
CONFIGURE_PATH /usr/local/etc/ImageMagick-6/
 

Tux

New member
Joined
Mar 18, 2013
Messages
7
Tux

I fixed the issue. Its invalid path in configure.

In my case my ImageMagick.h file was located in /usr/local/include/ImageMagick-6/wand/

so i created a symbolic link to the path since its looking for /ImageMagick with no "-6"

ln -s /usr/local/include/ImageMagick-6 /usr/local/include/ImageMagick

bingo! configure works....
I'll try it tomorrow. In any case thanks for your response !
 

Tux

New member
Joined
Mar 18, 2013
Messages
7
Now when I try to make imagick I get the following errors:

/root/imagick-3.0.1/imagick_class.c:9669: error: âstatusâ undeclared (first use in this function)
/root/imagick-3.0.1/imagick_class.c:9672: error: âMagickFalseâ undeclared (first use in this function)
/root/imagick-3.0.1/imagick_class.c:9673: error: âExceptionTypeâ undeclared (first use in this function)
/root/imagick-3.0.1/imagick_class.c:9673: error: expected â;â before âseverityâ
/root/imagick-3.0.1/imagick_class.c:9673: error: âseverityâ undeclared (first use in this function)
/root/imagick-3.0.1/imagick_class.c:9673: error: too many arguments to function âMagickGetExceptionâ

So strange, I have installed imagick a lot of times, but suddenly I can't get it to work anymore.
 

ditto

Verified User
Joined
Apr 27, 2009
Messages
2,557
I have found the solution to this. It is because /ImageMagick/ is hardcoded in a imagick file, and in newer versions of ImageMagick that a folder is named with a version number, hence imagick can't find the folder and give you this error when you do ./configure:

Code:
checking for MagickWand.h header file... configure: error: Cannot locate header file MagickWand.h
I found the solution in this forum post: http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=22887#p95800

What you need to do is first go to this path: /usr/local/include/ In that path you look for the ImageMagick folder, in my case it was named "ImageMagick-6", but the version number might change in future, therfor first check that path to see what number there is in you ImageMagick folder name.

Then, after doing:
Code:
wget http://pecl.php.net/get/imagick-3.1.0RC2.tgz
tar zxf imagick-3.1.0RC2.tgz
You edit this file: /root/imagick-3.1.0RC2/config.m4

In that file you change line number 55 that looks like this:
Code:
if test -r $WAND_DIR/include/[B]ImageMagick[/B]/wand/MagickWand.h; then
you change it to look like this:
Code:
if test -r $WAND_DIR/include/[B]ImageMagick-6[/B]/wand/MagickWand.h; then
Then you continue the commands:
Code:
cd imagick-3.1.0RC2
phpize
./configure
make
make install
I will update my guide, or post a link in my guide to this post.
 
Last edited:

wazburn

Verified User
Joined
Nov 26, 2011
Messages
70
# ./configure
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr/local
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20090626
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking whether to enable the imagick extension... yes, shared
checking whether to enable the imagick GraphicsMagick backend... no
checking ImageMagick MagickWand API configuration program... found in /usr/local/bin/MagickWand-config
checking if ImageMagick version is at least 6.2.4... found version 6.8.6 Q16
checking for MagickWand.h header file... found in /usr/local/include/ImageMagick/wand/MagickWand.h
checking PHP version is at least 5.1.3... yes. found 5.3.26
Package MagickWand was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickWand.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickWand' found
Package MagickWand was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickWand.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickWand' found




:confused:
 

mike shooltz

New member
Joined
Sep 7, 2013
Messages
1
The solution you need.

# ./configure

Package MagickWand was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickWand.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickWand' found
Package MagickWand was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickWand.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickWand' found


:confused:
That can be resolver usually be specifying your PKG_CONFIG_PATH before you build.

for example I had to run:
cd /usr/local/src
wget http://pecl.php.net/get/imagick-3.1.0RC2.tgz
tar -zxvf imagick-3.1.0RC2.tgz
cd imagick-3.1.0RC2
ln -s /usr/local/include/ImageMagick-6 /usr/local/include/ImageMagick
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
phpize
./configure
make
make install
echo "extension=imagick.so" >> /usr/local/lib/php.ini
/etc/init.d/httpd restart

That installed for me with no problems, however your PKG_CONFIG_PATH might be different. Run an:

updatedb && locate pkgconfig

To verify if you have problems, ENJOY.
 

frednoob

Verified User
Joined
Feb 15, 2007
Messages
92
i got this error when run command make install on ImageMagick6.8.8-8

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/bin/mkdir -p '/usr/local/bin'
/bin/sh ./libtool --mode=install /usr/bin/install -c utilities/animate utilities/compare utilities/composite utilities/conjure utilities/convert utilities/display utilities/identify utilities/import utilities/mogrify utilities/montage utilities/stream '/usr/local/bin'
libtool: install: /usr/bin/install -c utilities/.libs/animate /usr/local/bin/animate
libtool: install: /usr/bin/install -c utilities/.libs/compare /usr/local/bin/compare
libtool: install: /usr/bin/install -c utilities/.libs/composite /usr/local/bin/composite
libtool: install: /usr/bin/install -c utilities/.libs/conjure /usr/local/bin/conjure
libtool: install: /usr/bin/install -c utilities/.libs/convert /usr/local/bin/convert
libtool: install: /usr/bin/install -c utilities/.libs/display /usr/local/bin/display
libtool: install: /usr/bin/install -c utilities/.libs/identify /usr/local/bin/identify
libtool: install: /usr/bin/install -c utilities/.libs/import /usr/local/bin/import
libtool: install: /usr/bin/install -c utilities/.libs/mogrify /usr/local/bin/mogrify
libtool: install: /usr/bin/install -c utilities/.libs/montage /usr/local/bin/montage
libtool: install: /usr/bin/install -c utilities/.libs/stream /usr/local/bin/stream
/bin/mkdir -p '/usr/local/bin'
/usr/bin/install -c magick/Magick-config magick/MagickCore-config wand/Wand-config wand/MagickWand-config Magick++/bin/Magick++-config '/usr/local/bin'
cd PerlMagick && /usr/bin/perl Makefile.PL
Can't locate ExtUtils/MakeMaker.pm in @INC (@INC contains: /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .) at Makefile.PL line 24.
BEGIN failed--compilation aborted at Makefile.PL line 24.
make[3]: *** [PerlMagick/Makefile] Error 2
make[3]: Leaving directory `/root/ImageMagick-6.8.8-8'
make[2]: *** [install-am] Error 2
make[2]: Leaving directory `/root/ImageMagick-6.8.8-8'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/root/ImageMagick-6.8.8-8'
make: *** [install] Error 2
anyone can help ??

i've try using update.scripts but it seems not running ....
 

Stokie

New member
Joined
Mar 18, 2016
Messages
1
i got this error when run command make install on ImageMagick6.8.8-8



anyone can help ??

i've try using update.scripts but it seems not running ....
Hi Fred, I'm getting the same error trying to install Image Magick. Is the command wrong? Did you figure out how to get it installed?
 
Top