Cannot locate header file MagickWand.h

今天编译安装PHP拓展imagick的时候,总是提示:

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

跳不过去,缺少头文件

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... configure: error: Cannot locate header file MagickWand.h

后来查看了源代码,发现目录有改变,以前是ImageMagick,现在是ImageMagick-6。

要解决这个问题很简单,要么指定include目录位置,要么直接软链接

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

然后继续原来的步骤配置编译安装

分享

TITLE: Cannot locate header file MagickWand.h

LINK: https://www.qttc.net/363-php-cannot-locate-header-file-magickwand.html

NOTE: 原创内容,转载请注明出自琼台博客