1

我在安装 Imagick 时遇到问题,因为我刚刚将 ImageMagick 6.8.1 Q16 安装到我们的 CentOS 6.3 系统上

请注意,我以 root 身份运行所有命令

然后我正在尝试以下操作: pecl install imagick 并出现以下错误(完全错误):

[root@T1600-904 /]# pecl install imagick
downloading imagick-3.1.0RC2.tgz ...
Starting to download imagick-3.1.0RC2.tgz (93,264 bytes)
.....................done: 93,264 bytes
15 source files, building
running: phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
Please provide the prefix of Imagemagick installation [autodetect] :
building in /tmp/pear/install/pear-build-rootPvQgOJ/imagick-3.1.0RC2
running: /tmp/pear/install/imagick/configure --with-imagick
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
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM 
-I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory... /usr/lib64/php/modules
checking for PHP installed headers prefix... /usr/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.1 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.3
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
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1966080
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
running: make
/bin/sh /tmp/pear/install/pear-build-rootPvQgOJ/imagick-3.1.0RC2/libtool --mode=compile cc  -I.
 -I/tmp/pear/install/imagick -DPHP_ATOM_INC -I/tmp/pear/install/pear-build-rootPvQgOJ/imagick-
3.1.0RC2/include -I/tmp/pear/install/pear-build-rootPvQgOJ/imagick-3.1.0RC2/main -I/tmp
/pear/install/imagick -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr
/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g 
-O2   -c /tmp/pear/install/imagick/imagick_file.c -o imagick_file.lo
libtool: compile:  cc -I. -I/tmp/pear/install/imagick -DPHP_ATOM_INC -I/tmp/pear/install/pear-
build-rootPvQgOJ/imagick-3.1.0RC2/include -I/tmp/pear/install/pear-build-rootPvQgOJ/imagick-
3.1.0RC2/main -I/tmp/pear/install/imagick -I/usr/include/php -I/usr/include/php/main -I/usr
/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext
/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/install/imagick/imagick_file.c  -fPIC -DPIC -o 
.libs/imagick_file.o
In file included from /tmp/pear/install/imagick/imagick_file.c:21:
/tmp/pear/install/imagick/php_imagick.h:49:31: error: wand/MagickWand.h: No such file or   
directory
In file included from /tmp/pear/install/imagick/php_imagick_file.h:24,
             from /tmp/pear/install/imagick/imagick_file.c:22:
/tmp/pear/install/imagick/php_imagick_defs.h:72: error: expected specifier-qualifier-list
 before âMagickWandâ
/tmp/pear/install/imagick/php_imagick_defs.h:80: error: expected specifier-qualifier-list
 before âDrawingWandâ
/tmp/pear/install/imagick/php_imagick_defs.h:86: error: expected specifier-qualifier-list 
before âPixelIteratorâ
/tmp/pear/install/imagick/php_imagick_defs.h:98: error: expected specifier-qualifier-list 
before âPixelWandâ
In file included from /tmp/pear/install/imagick/imagick_file.c:22:
/tmp/pear/install/imagick/php_imagick_file.h:43: error: âMaxTextExtentâ undeclared here (not in 
a function)
/tmp/pear/install/imagick/imagick_file.c: In function âphp_imagick_file_initâ:
/tmp/pear/install/imagick/imagick_file.c:75: error: âMagickPathâ undeclared (first use in this 
function)
/tmp/pear/install/imagick/imagick_file.c:75: error: (Each undeclared identifier is reported 
only once
/tmp/pear/install/imagick/imagick_file.c:75: error: for each function it appears in.)
/tmp/pear/install/imagick/imagick_file.c:99: error: âHeadPathâ undeclared (first use in this
 function)
/tmp/pear/install/imagick/imagick_file.c:100: error: âTailPathâ undeclared (first use in this 
function)
/tmp/pear/install/imagick/imagick_file.c: In function 
âphp_imagick_read_image_using_imagemagickâ:
/tmp/pear/install/imagick/imagick_file.c:124: error: âphp_imagick_objectâ has no member named 
âmagick_wandâ
/tmp/pear/install/imagick/imagick_file.c:124: error: âMagickFalseâ undeclared (first use in 
this function)
/tmp/pear/install/imagick/imagick_file.c:128: error: âphp_imagick_objectâ has no member named
 âmagick_wandâ
/tmp/pear/install/imagick/imagick_file.c:135: error: âphp_imagick_objectâ has no member named 
âmagick_wandâ
/tmp/pear/install/imagick/imagick_file.c:137: error: âphp_imagick_objectâ has no member named 
âmagick_wandâ
/tmp/pear/install/imagick/imagick_file.c: In function 
âphp_imagick_read_image_using_php_streamsâ:
/tmp/pear/install/imagick/imagick_file.c:144: error: âMagickBooleanTypeâ undeclared (first use 
in this function)
/tmp/pear/install/imagick/imagick_file.c:144: error: expected â;â before âstatusâ
/tmp/pear/install/imagick/imagick_file.c:177: error: âstatusâ undeclared (first use in this 
function)
/tmp/pear/install/imagick/imagick_file.c:177: error: âphp_imagick_objectâ has no member named 
âmagick_wandâ
/tmp/pear/install/imagick/imagick_file.c:179: error: âphp_imagick_objectâ has no member named 
âmagick_wandâ
/tmp/pear/install/imagick/imagick_file.c:184: error: âMagickFalseâ undeclared (first use in
 this function)
/tmp/pear/install/imagick/imagick_file.c:189: error: âphp_imagick_objectâ has no member named 
âmagick_wandâ
/tmp/pear/install/imagick/imagick_file.c:196: error: âphp_imagick_objectâ has no member named 
âmagick_wandâ
/tmp/pear/install/imagick/imagick_file.c: In function âphp_imagick_write_fileâ:
/tmp/pear/install/imagick/imagick_file.c:247: error: âMagickBooleanTypeâ undeclared (first use 
in this function)
/tmp/pear/install/imagick/imagick_file.c:247: error: expected â;â before âstatusâ
/tmp/pear/install/imagick/imagick_file.c:258: error: âstatusâ undeclared (first use in this 
function)
/tmp/pear/install/imagick/imagick_file.c:258: error: âphp_imagick_objectâ has no member named 
âmagick_wandâ
/tmp/pear/install/imagick/imagick_file.c:260: error: âphp_imagick_objectâ has no member named 
âmagick_wandâ
/tmp/pear/install/imagick/imagick_file.c:264: error: âMagickFalseâ undeclared (first use in 
this function)
/tmp/pear/install/imagick/imagick_file.c: In function âphp_imagick_stream_handlerâ:
/tmp/pear/install/imagick/imagick_file.c:277: error: âMagickBooleanTypeâ undeclared (first use 
in this function)
/tmp/pear/install/imagick/imagick_file.c:277: error: expected â;â before âstatusâ
/tmp/pear/install/imagick/imagick_file.c:306: error: âstatusâ undeclared (first use in this 
function)
/tmp/pear/install/imagick/imagick_file.c:306: error: âphp_imagick_objectâ has no member named 
âmagick_wandâ
/tmp/pear/install/imagick/imagick_file.c:310: error: âphp_imagick_objectâ has no member named 
âmagick_wandâ
/tmp/pear/install/imagick/imagick_file.c:314: error: âphp_imagick_objectâ has no member named 
âmagick_wandâ
/tmp/pear/install/imagick/imagick_file.c:318: error: âphp_imagick_objectâ has no member named 
âmagick_wandâ
/tmp/pear/install/imagick/imagick_file.c:326: error: âMagickFalseâ undeclared (first use in 
this function)
make: *** [imagick_file.lo] Error 1
ERROR: `make' failed
4

1 回答 1

0

查看上面的输出,安装出错的地方是:

In file included from /tmp/pear/install/imagick/imagick_file.c:21:
/tmp/pear/install/imagick/php_imagick.h:49:31: error: wand/MagickWand.h: No such file or   
directory

意思'MagickWand.h'是,找不到。

首先,您可以尝试'pkg-config'按照要求安装/usr/local/bin/Wand-config

$ yum install pkg-config

并尝试再次安装imagick,这可能会解决问题。

如果没有,请尝试手动安装并更改'config.m4'源目录中的文件以匹配安装实际查找的内容。如下:

$ cd /usr/local
$ wget http://pecl.php.net/get/imagick-2.2.2.tgz
$ tar zxvf ./imagick-2.2.2.tgz
$ cd imagick-2.2.2

然后,在您继续打开config.m4文件之前:

$ nano config.m4

找到这一行:

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

并将其更改为:

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

注意:ImageMagick-6。更改它以匹配您所需的路径/版本。

并继续安装:

$ phpize
$ ./configure
$ make
$ make test
$ make install

希望这可以帮助某人...

于 2014-04-02T05:28:25.943 回答