如何在XAMPP上安装Imagick? [Ubuntu 12.04]

时间:2012-09-03 22:07:27

标签: php ubuntu xampp imagick

我正在尝试使用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文件,或者为什么它丢失了。

我也尝试使用a topic I found from two years ago,但是当我下载the source code时,没有任何configure个文件,所以我无法继续。

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

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

谢谢!

2 个答案:

答案 0 :(得分:1)

Ubuntu基于Debian,我不喜欢Debian的一件事是有时官方(稳定)软件包远远落后于供应商提供的软件包。幸运的是,对于Debian和Ubuntu,你可以使用dotdeb存储库,它可以与所有最受欢迎的软件包(如mysql,php等)保持同步。如果您不熟悉,只需查看dotdeb repository(或直接on their setup instructions)并从那里安装PHP及相关内容。如果缺少任何包,请在step-by-step instruction on how to make one yourself

答案 1 :(得分:1)

为什么不使用Advanced Packaging Tool?

Ubuntu 12.04的安装设置

  1. 安装imagemagick:

    sudo apt-get install imagemagick

  2. 安装imagemagick PECL扩展程序:

    sudo apt-get install php5-imagick

相关问题