dongzhi4239 2012-09-03 22:07
浏览 131
已采纳

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

I'm trying to install Image Magick on my Ubuntu machine using XAMPP, but so far no luck. I've tried installing the packages php5-imagick, but it states that the dependencies are not met:

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

I've tried compiling the Image Magick package and then using pecl to install it, but it stops.

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

I don't know what php.h file is missing, or why it's missing.

I also tried with a topic I found from two years ago, but when I download the source code, there are no any configure files, so I can't go on.

I'm really desperate as nothing works, I do have another PHP version installed (5.4.6), but I don't think that's the issue.

Can you guys provide some light on this?

Thank you!

  • 写回答

2条回答 默认 最新

  • dt2015 2012-09-03 23:03
    关注

    Ubuntu is based on Debian and one thing I dislike with Debian is that sometimes official (stable) packages are too far behind what vendor provides. Fortunately for both Debian and Ubuntu you can use dotdeb repository, which stays up to date with all the most popular packages (like mysql, php etc). If you are not familiar, simply take a look at dotdeb repository (or directly on their setup instructions) and install PHP and related stuff from there. If any package is missing, here their step-by-step instruction on how to make one yourself.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗
  • ¥15 钢筋实图交点识别,机器视觉代码
  • ¥15 如何在Linux系统中,但是在window系统上idea里面可以正常运行?(相关搜索:jar包)
  • ¥50 400g qsfp 光模块iphy方案
  • ¥15 两块ADC0804用proteus仿真时,出现异常