2012-09-03 200 views
1

我想在我的Ubuntu機器上使用XAMPP安裝Image Magick,但到目前爲止沒有運氣。 我試着安裝軟件包php5-imagick,但它指出,依賴得不到滿足:如何在XAMPP上安裝Imagick? [Ubuntu 12.04]

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

我已經試過編譯難懂的包,然後使用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),但我不認爲這是問題。

你們可以提供一些這方面的燈​​光?

謝謝!

回答

1

Ubuntu基於Debian,我不喜歡Debian的一件事是有時官方(stable)軟件包遠遠落後於供應商提供的軟件包。幸運的是,對於Debian和Ubuntu,您都可以使用dotdeb存儲庫,該存儲庫可與所有最流行的軟件包(如mysql,php等)保持同步。如果你不熟悉,只需看看dotdeb repository(或直接on their setup instructions)並從那裏安裝PHP和相關的東西。如果有任何包裹丟失,在這裏他們的step-by-step instruction on how to make one yourself

1

爲什麼不使用高級包裝工具?

安裝設置爲的Ubuntu 12.04

  1. 安裝ImageMagick的:

    sudo apt-get install imagemagick

  2. 安裝ImageMagick的PECL擴展:

    sudo apt-get install php5-imagick