1

我正在尝试使用 XAMPP 在我的 Ubuntu 机器上安装 Image Magick,但到目前为止还没有运气。我试过安装包php5-imagick,但它指出不满足依赖关系:

The following packages have unmet dependencies:
 php5-imagick : Depends: phpapi-20090626

我尝试编译 Image Magick 包,然后使用pecl它来安装它,但它停止了。

lampp/bin  » sudo ./pecl install imagick
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading imagick-3.0.1.tgz ...
Starting to download imagick-3.0.1.tgz (93,920 bytes)
.....................done: 93,920 bytes
13 source files, building
running: phpize
grep: /opt/lampp/include/php/main/php.h: No such file or directory
grep: /opt/lampp/include/php/Zend/zend_modules.h: No such file or directory
grep: /opt/lampp/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
configure.in:3: warning: prefer named diversions
configure.in:3: warning: prefer named diversions
Please provide the prefix of Imagemagick installation [autodetect] : 
building in /tmp/pear/temp/pear-build-root0hHzBG/imagick-3.0.1
running: /tmp/pear/temp/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 whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
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... /opt/lampp
checking for PHP includes... -I/opt/lampp/include/php -I/opt/lampp/include/php/main -I/opt/lampp/include/php/TSRM -I/opt/lampp/include/php/Zend -I/opt/lampp/include/php/ext -I/opt/lampp/include/php/ext/date/lib
checking for PHP extension directory... /opt/lampp/lib/php/extensions/no-debug-non-zts-20090626
checking for PHP installed headers prefix... /opt/lampp/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... no
checking for nawk... nawk
checking if nawk is broken... no
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.7.9 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.8
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
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 string.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 dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 1572864
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... 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

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/bash /tmp/pear/temp/pear-build-root0hHzBG/imagick-3.0.1/libtool --mode=compile cc  -I. -I/tmp/pear/temp/imagick -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-root0hHzBG/imagick-3.0.1/include -I/tmp/pear/temp/pear-build-root0hHzBG/imagick-3.0.1/main -I/tmp/pear/temp/imagick -I/opt/lampp/include/php -I/opt/lampp/include/php/main -I/opt/lampp/include/php/TSRM -I/opt/lampp/include/php/Zend -I/opt/lampp/include/php/ext -I/opt/lampp/include/php/ext/date/lib -I/usr/local/include/ImageMagick  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/imagick/imagick_class.c -o imagick_class.lo
mkdir .libs
 cc -I. -I/tmp/pear/temp/imagick -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-root0hHzBG/imagick-3.0.1/include -I/tmp/pear/temp/pear-build-root0hHzBG/imagick-3.0.1/main -I/tmp/pear/temp/imagick -I/opt/lampp/include/php -I/opt/lampp/include/php/main -I/opt/lampp/include/php/TSRM -I/opt/lampp/include/php/Zend -I/opt/lampp/include/php/ext -I/opt/lampp/include/php/ext/date/lib -I/usr/local/include/ImageMagick -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/imagick/imagick_class.c  -fPIC -DPIC -o .libs/imagick_class.o
In file included from /tmp/pear/temp/imagick/imagick_class.c:21:0:
/tmp/pear/temp/imagick/php_imagick.h:40:17: fatal error: php.h: No such file or directory
compilation terminated.
make: *** [imagick_class.lo] Error 1
ERROR: `make' failed

我不知道什么php.h文件丢失了,或者为什么它丢失了。

我也尝试了两年前找到的一个主题,但是当我下载源代码时,没有任何configure文件,所以我无法继续。

我真的很绝望,因为没有任何效果,我确实安装了另一个 PHP 版本(5.4.6),但我认为这不是问题所在。

你们能对此提供一些启示吗?

谢谢!

4

2 回答 2

1

Ubuntu 基于 Debian,我不喜欢 Debian 的一件事是,有时官方(稳定)软件包远远落后于供应商提供的软件包。幸运的是,对于 Debian 和 Ubuntu,您都可以使用 dotdeb 存储库,它与所有最流行的软件包(如 mysql、php 等)保持同步。如果您不熟悉,只需查看dotdeb 存储库(或直接在他们的设置说明中)并从那里安装 PHP 和相关的东西。如果缺少任何包装,请在此处查看有关如何自己制作的分步说明

于 2012-09-03T23:03:57.103 回答
1

为什么不使用高级打包工具?

Ubuntu 12.04的安装设置:

  1. 安装 imagemagick:

    sudo apt-get install imagemagick

  2. 安装 imagemagick PECL 扩展:

    sudo apt-get install php5-imagick

于 2013-08-12T17:48:18.097 回答