Imagick / imagick

🌈 The Imagick PHP extension 🌈
http://pecl.php.net/imagick
Other
540 stars 136 forks source link

Error during Imagick installation: 'MagickWand/MagickWand.h' file not found #654

Closed dadastudio closed 7 months ago

dadastudio commented 7 months ago

Hi there,

I'm trying to install the Imagick extension on my new mac M2 (Sonoma) using PECL, but I'm encountering an error during the installation process. Here's the command I'm using: pecl install imagick

The installation fails with the following error:

running: make
/bin/sh /private/tmp/pear/temp/pear-build-michaljarocinskiRL8IS2/imagick-3.7.0/libtool --mode=compile cc -I. -I/private/tmp/pear/temp/imagick -I/private/tmp/pear/temp/pear-build-michaljarocinskiRL8IS2/imagick-3.7.0/include -I/private/tmp/pear/temp/pear-build-michaljarocinskiRL8IS2/imagick-3.7.0/main -I/private/tmp/pear/temp/imagick -I/opt/homebrew/Cellar/php@8.2/8.2.15/include/php -I/opt/homebrew/Cellar/php@8.2/8.2.15/include/php/main -I/opt/homebrew/Cellar/php@8.2/8.2.15/include/php/TSRM -I/opt/homebrew/Cellar/php@8.2/8.2.15/include/php/Zend -I/opt/homebrew/Cellar/php@8.2/8.2.15/include/php/ext -I/opt/homebrew/Cellar/php@8.2/8.2.15/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2 -D_GNU_SOURCE    -DZEND_COMPILE_DL_EXT=1 -c /private/tmp/pear/temp/imagick/imagick_file.c -o imagick_file.lo  -MMD -MF imagick_file.dep -MT imagick_file.lo
mkdir .libs
 cc -I. -I/private/tmp/pear/temp/imagick -I/private/tmp/pear/temp/pear-build-michaljarocinskiRL8IS2/imagick-3.7.0/include -I/private/tmp/pear/temp/pear-build-michaljarocinskiRL8IS2/imagick-3.7.0/main -I/private/tmp/pear/temp/imagick -I/opt/homebrew/Cellar/php@8.2/8.2.15/include/php -I/opt/homebrew/Cellar/php@8.2/8.2.15/include/php/main -I/opt/homebrew/Cellar/php@8.2/8.2.15/include/php/TSRM -I/opt/homebrew/Cellar/php@8.2/8.2.15/include/php/Zend -I/opt/homebrew/Cellar/php@8.2/8.2.15/include/php/ext -I/opt/homebrew/Cellar/php@8.2/8.2.15/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -DZEND_COMPILE_DL_EXT=1 -c /private/tmp/pear/temp/imagick/imagick_file.c -MMD -MF imagick_file.dep -MT imagick_file.lo  -fno-common -DPIC -o .libs/imagick_file.o
In file included from /private/tmp/pear/temp/imagick/imagick_file.c:22:
In file included from /private/tmp/pear/temp/imagick/php_imagick_file.h:24:
/private/tmp/pear/temp/imagick/php_imagick_defs.h:25:12: fatal error: 'MagickWand/MagickWand.h' file not found
#  include <MagickWand/MagickWand.h>
           ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [imagick_file.lo] Error 1
ERROR: `make' failed

It seems like the compiler is unable to find the 'MagickWand/MagickWand.h' file. I've checked and the file does exist in the specified location (/usr/local/include/ImageMagick-7/MagickWand/MagickWand.h).

I'm using PHP 8.2.15 and ImageMagick version 7.1.1-26 Q16 HDRI. This Mac was set up from a backup of an Intel architecture Mac (maybe that matters?).

Any help on how to resolve this issue would be greatly appreciated. Thank you!

Danack commented 7 months ago

This Mac was set up from a backup of an Intel architecture Mac (maybe that matters?).

Yes.

Just the architecture change would be enough to cause a problem, but my understanding is that there have been changes in which compiler tools OSX uses by default. Restoring from a backup is likely to have some left overs from previous compilation/install steps that are no longer appopropriate.

I'd recommend removing everything that was compiled before, and starting over from scratch from a new download, in a new temp directory, starting the compilation steps from scratch (e.g. phpize and configure).

And I'll be willing to help with problems encountered then, but I can't help with problems like what you're seeing apart from to say "yeah, you need to start again from scratch".