Imagickをインストール


2.2.2は動かないので2.2.1を指定してpeclでインストール

$ sudo pecl install Imagick-2.2.1
downloading imagick-2.2.1.tgz ...
Starting to download imagick-2.2.1.tgz (75,873 bytes)
.................done: 75,873 bytes
11 source files, building
running: phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519
configure.in:77: warning: AC_CACHE_VAL(lt_prog_compiler_static_works, ...): suspicious cache-id, must contain _cv_ to be cached
../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:1994: AC_CACHE_CHECK is expanded from...
aclocal.m4:3526: AC_LIBTOOL_LINKER_OPTION is expanded from...
aclocal.m4:5464: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:5463: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:2943: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:2923: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:2886: AC_PROG_LIBTOOL is expanded from...
configure.in:77: the top level
configure.in:77: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:3481: AC_LIBTOOL_COMPILER_OPTION is expanded from...
aclocal.m4:7591: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
configure.in:77: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_CXX, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:5577: _LT_AC_LANG_CXX_CONFIG is expanded from...
aclocal.m4:5576: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
aclocal.m4:4612: _LT_AC_TAGCONFIG is expanded from...
configure.in:77: warning: AC_CACHE_VAL(lt_prog_compiler_static_works, ...): suspicious cache-id, must contain _cv_ to be cached
../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:1994: AC_CACHE_CHECK is expanded from...
aclocal.m4:3526: AC_LIBTOOL_LINKER_OPTION is expanded from...
aclocal.m4:5464: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:5463: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:2943: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:2923: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:2886: AC_PROG_LIBTOOL is expanded from...
configure.in:77: the top level
configure.in:77: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:3481: AC_LIBTOOL_COMPILER_OPTION is expanded from...
aclocal.m4:7591: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
configure.in:77: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_CXX, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:5577: _LT_AC_LANG_CXX_CONFIG is expanded from...
aclocal.m4:5576: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
aclocal.m4:4612: _LT_AC_TAGCONFIG is expanded from...
 1. Please provide the prefix of Imagemagick installation : autodetect

1-1, 'all', 'abort', or Enter to continue: 
building in /var/tmp/pear-build-root/imagick-2.2.1
running: /opt/local/temp/imagick/configure --with-imagick
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for gcc... gcc
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 gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc and cc understand -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... i686-apple-darwin9.6.0
checking host system type... i686-apple-darwin9.6.0
checking target system type... i686-apple-darwin9.6.0
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/lib/php/extensions/no-debug-non-zts-20060613
checking for PHP installed headers prefix... /usr/include/php
checking for re2c... no
configure: WARNING: You will need re2c 0.12.0 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk 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/bin/MagickWand-config
checking for MagickWand.h header file... found in /opt/local/include/ImageMagick/wand/MagickWand.h
checking if ImageMagick version is at least 6.2.4... found version 6.4.9 Q16
checking if PHP version is at least 5.1.3... found version 5.2.6
checking for ld used by gcc... /usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld
checking if the linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) is GNU ld... no
checking for /usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -p
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
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... 196608
checking command to parse /usr/bin/nm -p output from gcc object... rm: conftest.dSYM: is a directory
ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
checking if gcc static flag  works... rm: conftest.dSYM: is a directory
yes
checking if gcc supports -fno-rtti -fno-exceptions... rm: conftest.dSYM: is a directory
no
checking for gcc option to produce PIC... -fno-common
checking if gcc PIC flag -fno-common works... rm: conftest.dSYM: is a directory
yes
checking if gcc supports -c -o file.o... rm: conftest.dSYM: is a directory
yes
checking whether the gcc linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin9.6.0 dyld
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/sh /private/var/tmp/pear-build-root/imagick-2.2.1/libtool --mode=compile gcc  -I. -I/opt/local/temp/imagick -DPHP_ATOM_INC -I/private/var/tmp/pear-build-root/imagick-2.2.1/include -I/private/var/tmp/pear-build-root/imagick-2.2.1/main -I/opt/local/temp/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 -I/opt/local/include/ImageMagick  -DHAVE_CONFIG_H  -g -O2   -c /opt/local/temp/imagick/imagick_class.c -o imagick_class.lo
mkdir .libs
 gcc -I. -I/opt/local/temp/imagick -DPHP_ATOM_INC -I/private/var/tmp/pear-build-root/imagick-2.2.1/include -I/private/var/tmp/pear-build-root/imagick-2.2.1/main -I/opt/local/temp/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 -I/opt/local/include/ImageMagick -DHAVE_CONFIG_H -g -O2 -c /opt/local/temp/imagick/imagick_class.c  -fno-common -DPIC -o .libs/imagick_class.o
/opt/local/temp/imagick/imagick_class.c: In function ‘zim_imagick_getimageprofiles’:
/opt/local/temp/imagick/imagick_class.c:1122: warning: pointer targets in assignment differ in signedness
/opt/local/temp/imagick/imagick_class.c: In function ‘zim_imagick_getpage’:
/opt/local/temp/imagick/imagick_class.c:7774: warning: pointer targets in passing argument 2 of ‘MagickGetPage’ differ in signedness
/opt/local/temp/imagick/imagick_class.c:7774: warning: pointer targets in passing argument 3 of ‘MagickGetPage’ differ in signedness
/opt/local/temp/imagick/imagick_class.c: In function ‘zim_imagick_getquantumdepth’:
/opt/local/temp/imagick/imagick_class.c:7800: warning: pointer targets in passing argument 1 of ‘MagickGetQuantumDepth’ differ in signedness
/opt/local/temp/imagick/imagick_class.c: In function ‘zim_imagick_getquantumrange’:
/opt/local/temp/imagick/imagick_class.c:7821: warning: pointer targets in passing argument 1 of ‘MagickGetQuantumRange’ differ in signedness
/opt/local/temp/imagick/imagick_class.c: In function ‘zim_imagick_getsamplingfactors’:
/opt/local/temp/imagick/imagick_class.c:7895: warning: pointer targets in passing argument 2 of ‘MagickGetSamplingFactors’ differ in signedness
/opt/local/temp/imagick/imagick_class.c: In function ‘zim_imagick_getversion’:
/opt/local/temp/imagick/imagick_class.c:7942: warning: pointer targets in passing argument 1 of ‘MagickGetVersion’ differ in signedness
/bin/sh /private/var/tmp/pear-build-root/imagick-2.2.1/libtool --mode=compile gcc  -I. -I/opt/local/temp/imagick -DPHP_ATOM_INC -I/private/var/tmp/pear-build-root/imagick-2.2.1/include -I/private/var/tmp/pear-build-root/imagick-2.2.1/main -I/opt/local/temp/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 -I/opt/local/include/ImageMagick  -DHAVE_CONFIG_H  -g -O2   -c /opt/local/temp/imagick/imagickdraw_class.c -o imagickdraw_class.lo
 gcc -I. -I/opt/local/temp/imagick -DPHP_ATOM_INC -I/private/var/tmp/pear-build-root/imagick-2.2.1/include -I/private/var/tmp/pear-build-root/imagick-2.2.1/main -I/opt/local/temp/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 -I/opt/local/include/ImageMagick -DHAVE_CONFIG_H -g -O2 -c /opt/local/temp/imagick/imagickdraw_class.c  -fno-common -DPIC -o .libs/imagickdraw_class.o
/bin/sh /private/var/tmp/pear-build-root/imagick-2.2.1/libtool --mode=compile gcc  -I. -I/opt/local/temp/imagick -DPHP_ATOM_INC -I/private/var/tmp/pear-build-root/imagick-2.2.1/include -I/private/var/tmp/pear-build-root/imagick-2.2.1/main -I/opt/local/temp/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 -I/opt/local/include/ImageMagick  -DHAVE_CONFIG_H  -g -O2   -c /opt/local/temp/imagick/imagickpixel_class.c -o imagickpixel_class.lo
 gcc -I. -I/opt/local/temp/imagick -DPHP_ATOM_INC -I/private/var/tmp/pear-build-root/imagick-2.2.1/include -I/private/var/tmp/pear-build-root/imagick-2.2.1/main -I/opt/local/temp/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 -I/opt/local/include/ImageMagick -DHAVE_CONFIG_H -g -O2 -c /opt/local/temp/imagick/imagickpixel_class.c  -fno-common -DPIC -o .libs/imagickpixel_class.o
/bin/sh /private/var/tmp/pear-build-root/imagick-2.2.1/libtool --mode=compile gcc  -I. -I/opt/local/temp/imagick -DPHP_ATOM_INC -I/private/var/tmp/pear-build-root/imagick-2.2.1/include -I/private/var/tmp/pear-build-root/imagick-2.2.1/main -I/opt/local/temp/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 -I/opt/local/include/ImageMagick  -DHAVE_CONFIG_H  -g -O2   -c /opt/local/temp/imagick/imagickpixeliterator_class.c -o imagickpixeliterator_class.lo
 gcc -I. -I/opt/local/temp/imagick -DPHP_ATOM_INC -I/private/var/tmp/pear-build-root/imagick-2.2.1/include -I/private/var/tmp/pear-build-root/imagick-2.2.1/main -I/opt/local/temp/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 -I/opt/local/include/ImageMagick -DHAVE_CONFIG_H -g -O2 -c /opt/local/temp/imagick/imagickpixeliterator_class.c  -fno-common -DPIC -o .libs/imagickpixeliterator_class.o
/opt/local/temp/imagick/imagickpixeliterator_class.c: In function ‘zim_imagickpixeliterator_getcurrentiteratorrow’:
/opt/local/temp/imagick/imagickpixeliterator_class.c:380: warning: pointer targets in passing argument 2 of ‘PixelGetCurrentIteratorRow’ differ in signedness
/bin/sh /private/var/tmp/pear-build-root/imagick-2.2.1/libtool --mode=compile gcc  -I. -I/opt/local/temp/imagick -DPHP_ATOM_INC -I/private/var/tmp/pear-build-root/imagick-2.2.1/include -I/private/var/tmp/pear-build-root/imagick-2.2.1/main -I/opt/local/temp/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 -I/opt/local/include/ImageMagick  -DHAVE_CONFIG_H  -g -O2   -c /opt/local/temp/imagick/imagick_helpers.c -o imagick_helpers.lo
 gcc -I. -I/opt/local/temp/imagick -DPHP_ATOM_INC -I/private/var/tmp/pear-build-root/imagick-2.2.1/include -I/private/var/tmp/pear-build-root/imagick-2.2.1/main -I/opt/local/temp/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 -I/opt/local/include/ImageMagick -DHAVE_CONFIG_H -g -O2 -c /opt/local/temp/imagick/imagick_helpers.c  -fno-common -DPIC -o .libs/imagick_helpers.o
/bin/sh /private/var/tmp/pear-build-root/imagick-2.2.1/libtool --mode=compile gcc  -I. -I/opt/local/temp/imagick -DPHP_ATOM_INC -I/private/var/tmp/pear-build-root/imagick-2.2.1/include -I/private/var/tmp/pear-build-root/imagick-2.2.1/main -I/opt/local/temp/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 -I/opt/local/include/ImageMagick  -DHAVE_CONFIG_H  -g -O2   -c /opt/local/temp/imagick/imagick.c -o imagick.lo
 gcc -I. -I/opt/local/temp/imagick -DPHP_ATOM_INC -I/private/var/tmp/pear-build-root/imagick-2.2.1/include -I/private/var/tmp/pear-build-root/imagick-2.2.1/main -I/opt/local/temp/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 -I/opt/local/include/ImageMagick -DHAVE_CONFIG_H -g -O2 -c /opt/local/temp/imagick/imagick.c  -fno-common -DPIC -o .libs/imagick.o
/bin/sh /private/var/tmp/pear-build-root/imagick-2.2.1/libtool --mode=link gcc -DPHP_ATOM_INC -I/private/var/tmp/pear-build-root/imagick-2.2.1/include -I/private/var/tmp/pear-build-root/imagick-2.2.1/main -I/opt/local/temp/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 -I/opt/local/include/ImageMagick  -DHAVE_CONFIG_H  -g -O2   -o imagick.la -export-dynamic -avoid-version -prefer-pic -module -rpath /private/var/tmp/pear-build-root/imagick-2.2.1/modules  imagick_class.lo imagickdraw_class.lo imagickpixel_class.lo imagickpixeliterator_class.lo imagick_helpers.lo imagick.lo -Wl,-rpath,/opt/local/lib -L/opt/local/lib -lMagickWand -Wl,-rpath,/opt/local/lib -L/opt/local/lib -lMagickCore
gcc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/imagick.so -bundle  .libs/imagick_class.o .libs/imagickdraw_class.o .libs/imagickpixel_class.o .libs/imagickpixeliterator_class.o .libs/imagick_helpers.o .libs/imagick.o  -L/opt/local/lib /opt/local/lib/libMagickWand.dylib -L/usr/X11/lib /opt/local/lib/libtiff.dylib /opt/local/lib/libjpeg.dylib /opt/local/lib/libfontconfig.dylib /opt/local/lib/libiconv.dylib /opt/local/lib/libexpat.dylib /opt/local/lib/libfreetype.dylib /opt/local/lib/libXext.dylib /opt/local/lib/libXt.dylib /opt/local/lib/libbz2.dylib /opt/local/lib/libz.dylib /opt/local/lib/libltdl.dylib /opt/local/lib/libSM.dylib /opt/local/lib/libICE.dylib /opt/local/lib/libX11.dylib /opt/local/lib/libXau.dylib /opt/local/lib/libXdmcp.dylib /opt/local/lib/libMagickCore.dylib -Wl,-rpath -Wl,/opt/local/lib -Wl,-rpath -Wl,/opt/local/lib
creating imagick.la
(cd .libs && rm -f imagick.la && ln -s ../imagick.la imagick.la)
/bin/sh /private/var/tmp/pear-build-root/imagick-2.2.1/libtool --mode=install cp ./imagick.la /private/var/tmp/pear-build-root/imagick-2.2.1/modules
cp ./.libs/imagick.so /private/var/tmp/pear-build-root/imagick-2.2.1/modules/imagick.so
cp ./.libs/imagick.lai /private/var/tmp/pear-build-root/imagick-2.2.1/modules/imagick.la
----------------------------------------------------------------------
Libraries have been installed in:
   /private/var/tmp/pear-build-root/imagick-2.2.1/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
     during execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

running: make INSTALL_ROOT="/var/tmp/pear-build-root/install-imagick-2.2.1" install
Installing shared extensions:     /var/tmp/pear-build-root/install-imagick-2.2.1/usr/lib/php/extensions/no-debug-non-zts-20060613/
running: find "/var/tmp/pear-build-root/install-imagick-2.2.1" | xargs ls -dils
5573994   0 drwxr-xr-x  3 root  wheel     102 Mar 16 07:43 /var/tmp/pear-build-root/install-imagick-2.2.1
5574428   0 drwxr-xr-x  3 root  wheel     102 Mar 16 07:43 /var/tmp/pear-build-root/install-imagick-2.2.1/usr
5574429   0 drwxr-xr-x  3 root  wheel     102 Mar 16 07:43 /var/tmp/pear-build-root/install-imagick-2.2.1/usr/lib
5574430   0 drwxr-xr-x  3 root  wheel     102 Mar 16 07:43 /var/tmp/pear-build-root/install-imagick-2.2.1/usr/lib/php
5574431   0 drwxr-xr-x  3 root  wheel     102 Mar 16 07:43 /var/tmp/pear-build-root/install-imagick-2.2.1/usr/lib/php/extensions
5574432   0 drwxr-xr-x  2 root  wheel     102 Mar 16 07:43 /var/tmp/pear-build-root/install-imagick-2.2.1/usr/lib/php/extensions/no-debug-non-zts-20060613
5574433 664 -rwxr-xr-x  1 root  wheel  336056 Mar 16 07:43 /var/tmp/pear-build-root/install-imagick-2.2.1/usr/lib/php/extensions/no-debug-non-zts-20060613/imagick.so

Build process completed successfully
Installing '/usr/lib/php/extensions/no-debug-non-zts-20060613/imagick.so'
install ok: channel://pecl.php.net/imagick-2.2.1
configuration option "php_ini" is not set to php.ini location
You should add "extension=imagick.so" to php.ini
$

imagickでMagickWand-configがないとエラーが出たらシンボリックリンクを張り再度 pecl install imagick

$ sudo ln -s /opt/local/bin/MagickWand-config /usr/bin/

php.iniに記述を追加

$ sudo vi /etc/php.ini
extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20060613/"
extension=imagick.so

アパッチを再起動

$ sudo apachectl restart

return