PHP 拡張モジュールImagickの導入時に遭遇したPECLのバグの回避策など

Linux(CentOS 5.x)、PHP 5.1.6の環境において、PHP 拡張モジュールImagickをインストールする時にエラーとなってインストールが失敗することがある。その1つの例がPECLのバグだ。(今のところ、2つ目の例はまだ知らない・・・。)

まずは、「ImageMagick」、「ImageMagick-devel」をyumでインストールする。

[root@nobuneko lib]# yum install ImageMagick
[root@nobuneko lib]# yum install ImageMagick-devel

ここまでは順調。しかし、次で失敗。

[root@nobuneko lib]# pecl install imagick
downloading imagick-3.0.0.tgz ...
Starting to download imagick-3.0.0.tgz (93,488 bytes)
.....................done: 93,488 bytes
13 source files, building
running: phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20050922
Zend Extension Api No: 220051025
Please provide the prefix of Imagemagick installation [autodetect] :
building in /var/tmp/pear-build-root/imagick-3.0.0
running: /tmp/tmp1SodBd/imagick-3.0.0/configure --with-imagick
checking for egrep... grep -E
checking for a sed that does not truncate output... /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 ANSI C... none needed
checking whether gcc and cc understand -c and -o together... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-redhat-linux-gnu
checking host system type... x86_64-redhat-linux-gnu
checking target system type... x86_64-redhat-linux-gnu
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
checking for PHP extension directory... /usr/lib64/php/modules
checking for PHP installed headers prefix... /usr/include/php
checking for re2c... no
configure: WARNING: You will need re2c 0.9.11 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
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/Wand-config
checking if ImageMagick version is at least 6.2.4... found version 6.2.8
checking for magick-wand.h header file... found in /usr/include/wand/magick-wand.h
checking PHP version is at least 5.1.3... /tmp/tmp1SodBd/imagick-3.0.0/configure: line 3339: test: Usage: /usr/bin/php-config [--prefix|--includes|--ldflags|--libs|--extension-dir|--include-dir|--php-binary|--version]: integer expression expected
configure: error: no. found 5.1.6
ERROR: `/tmp/tmp1SodBd/imagick-3.0.0/configure --with-imagick' failed
You have mail in /var/spool/mail/root

さて、どうしようかなぁ、と思ってWebで探していたら、以下のページを発見。

http://pecl.php.net/bugs/bug.php?id=18057
[2010-08-12 14:46 UTC] mkoppanen at php dot net
This bug has been fixed in SVN.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.

Thank you for the report, and for helping us make PECL better.

This bug has been fixed in svn already. There hasn't been a release yet
but there will be one soonish.

どうやらPECLのバグのようだ。・・・そうですか。
とりあえず、上記のページの続きを読んでみる。

[2010-08-31 00:55 UTC] tharmor at gmail dot com
Any idea when CentOS 5.5 will see this bug fix in stable?
[2010-09-16 14:09 UTC] joris at timdm dot nl
Thank you for fixing the bug, but is there a workaround for?

r_nobu適当訳「バグを直してくれてありがとう、ところで、回避策ってない?」

《略》
The simplest workaround is to edit /usr/bin/php-config, find the
following lines:

--version)
echo $version;;


And add two more lines after them:

--vernum)
echo "50106";;

If that doesn't work, increase the "version number" of PHP until it does
:)

《r_nobu適当訳》
一番簡単な回避策は、/usr/bin/php-config(というファイル)を編集することだよ。

--version)
echo $version;;

って書いている行を見つけて、この行のすぐ下に次の2行を追記する。

--vernum)
echo "50106";;

もし、これでうまく動かない場合は、うまく動くようになるまで、PHPの「version number」(vernumのことだろう)の値を大きくしていけばよい(この何かいい加減な感じのアドバイスにちょっと笑ってしまった)。

私は、この「回避策」を使わせてもらうことにした。
おかげさまで、うまくいった!

[root@nobuneko bin]# pecl install imagick
downloading imagick-3.0.0.tgz ...
Starting to download imagick-3.0.0.tgz (93,488 bytes)
.....................done: 93,488 bytes
13 source files, building
running: phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20050922
Zend Extension Api No: 220051025
Please provide the prefix of Imagemagick installation [autodetect] :
building in /var/tmp/pear-build-root/imagick-3.0.0
running: /tmp/tmpoIotjA/imagick-3.0.0/configure --with-imagick
checking for egrep... grep -E
checking for a sed that does not truncate output... /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 ANSI C... none needed
checking whether gcc and cc understand -c and -o together... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-redhat-linux-gnu
checking host system type... x86_64-redhat-linux-gnu
checking target system type... x86_64-redhat-linux-gnu
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
checking for PHP extension directory... /usr/lib64/php/modules
checking for PHP installed headers prefix... /usr/include/php
checking for re2c... no
configure: WARNING: You will need re2c 0.9.11 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
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/Wand-config
checking if ImageMagick version is at least 6.2.4... found version 6.2.8
checking for magick-wand.h header file... found in /usr/include/wand/magick-wand.h
checking PHP version is at least 5.1.3... yes. found 5.1.6
checking for ld used by gcc... /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 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 for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking for g77... no
checking for f77... no
checking for xlf... no
checking for frt... no
checking for pgf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for f90... no
checking for xlf90... no
checking for pgf90... no
checking for epcf90... no
checking for f95... no
checking for fort... no
checking for xlf95... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for gfortran... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether accepts -g... no
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc 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
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
appending configuration tag "F77" to libtool
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /var/tmp/pear-build-root/imagick-3.0.0/libtool --mode=compile gcc -I. -I/tmp/tmpoIotjA/imagick-3.0.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/imagick-3.0.0/include -I/var/tmp/pear-build-root/imagick-3.0.0/main -I/tmp/tmpoIotjA/imagick-3.0.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /tmp/tmpoIotjA/imagick-3.0.0/imagick_class.c -o imagick_class.lo
mkdir .libs
gcc -I. -I/tmp/tmpoIotjA/imagick-3.0.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/imagick-3.0.0/include -I/var/tmp/pear-build-root/imagick-3.0.0/main -I/tmp/tmpoIotjA/imagick-3.0.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /tmp/tmpoIotjA/imagick-3.0.0/imagick_class.c -fPIC -DPIC -o .libs/imagick_class.o
/bin/sh /var/tmp/pear-build-root/imagick-3.0.0/libtool --mode=compile gcc -I. -I/tmp/tmpoIotjA/imagick-3.0.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/imagick-3.0.0/include -I/var/tmp/pear-build-root/imagick-3.0.0/main -I/tmp/tmpoIotjA/imagick-3.0.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /tmp/tmpoIotjA/imagick-3.0.0/imagickdraw_class.c -o imagickdraw_class.lo
gcc -I. -I/tmp/tmpoIotjA/imagick-3.0.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/imagick-3.0.0/include -I/var/tmp/pear-build-root/imagick-3.0.0/main -I/tmp/tmpoIotjA/imagick-3.0.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /tmp/tmpoIotjA/imagick-3.0.0/imagickdraw_class.c -fPIC -DPIC -o .libs/imagickdraw_class.o
/bin/sh /var/tmp/pear-build-root/imagick-3.0.0/libtool --mode=compile gcc -I. -I/tmp/tmpoIotjA/imagick-3.0.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/imagick-3.0.0/include -I/var/tmp/pear-build-root/imagick-3.0.0/main -I/tmp/tmpoIotjA/imagick-3.0.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /tmp/tmpoIotjA/imagick-3.0.0/imagickpixel_class.c -o imagickpixel_class.lo
gcc -I. -I/tmp/tmpoIotjA/imagick-3.0.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/imagick-3.0.0/include -I/var/tmp/pear-build-root/imagick-3.0.0/main -I/tmp/tmpoIotjA/imagick-3.0.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /tmp/tmpoIotjA/imagick-3.0.0/imagickpixel_class.c -fPIC -DPIC -o .libs/imagickpixel_class.o
/bin/sh /var/tmp/pear-build-root/imagick-3.0.0/libtool --mode=compile gcc -I. -I/tmp/tmpoIotjA/imagick-3.0.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/imagick-3.0.0/include -I/var/tmp/pear-build-root/imagick-3.0.0/main -I/tmp/tmpoIotjA/imagick-3.0.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /tmp/tmpoIotjA/imagick-3.0.0/imagickpixeliterator_class.c -o imagickpixeliterator_class.lo
gcc -I. -I/tmp/tmpoIotjA/imagick-3.0.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/imagick-3.0.0/include -I/var/tmp/pear-build-root/imagick-3.0.0/main -I/tmp/tmpoIotjA/imagick-3.0.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /tmp/tmpoIotjA/imagick-3.0.0/imagickpixeliterator_class.c -fPIC -DPIC -o .libs/imagickpixeliterator_class.o
/bin/sh /var/tmp/pear-build-root/imagick-3.0.0/libtool --mode=compile gcc -I. -I/tmp/tmpoIotjA/imagick-3.0.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/imagick-3.0.0/include -I/var/tmp/pear-build-root/imagick-3.0.0/main -I/tmp/tmpoIotjA/imagick-3.0.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /tmp/tmpoIotjA/imagick-3.0.0/imagick_helpers.c -o imagick_helpers.lo
gcc -I. -I/tmp/tmpoIotjA/imagick-3.0.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/imagick-3.0.0/include -I/var/tmp/pear-build-root/imagick-3.0.0/main -I/tmp/tmpoIotjA/imagick-3.0.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /tmp/tmpoIotjA/imagick-3.0.0/imagick_helpers.c -fPIC -DPIC -o .libs/imagick_helpers.o
/tmp/tmpoIotjA/imagick-3.0.0/imagick_helpers.c: In function 'php_imagick_validate_map':
/tmp/tmpoIotjA/imagick-3.0.0/imagick_helpers.c:227: warning: initialization discards qualifiers from pointer target type
/bin/sh /var/tmp/pear-build-root/imagick-3.0.0/libtool --mode=compile gcc -I. -I/tmp/tmpoIotjA/imagick-3.0.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/imagick-3.0.0/include -I/var/tmp/pear-build-root/imagick-3.0.0/main -I/tmp/tmpoIotjA/imagick-3.0.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /tmp/tmpoIotjA/imagick-3.0.0/imagick_read.c -o imagick_read.lo
gcc -I. -I/tmp/tmpoIotjA/imagick-3.0.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/imagick-3.0.0/include -I/var/tmp/pear-build-root/imagick-3.0.0/main -I/tmp/tmpoIotjA/imagick-3.0.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /tmp/tmpoIotjA/imagick-3.0.0/imagick_read.c -fPIC -DPIC -o .libs/imagick_read.o
/bin/sh /var/tmp/pear-build-root/imagick-3.0.0/libtool --mode=compile gcc -I. -I/tmp/tmpoIotjA/imagick-3.0.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/imagick-3.0.0/include -I/var/tmp/pear-build-root/imagick-3.0.0/main -I/tmp/tmpoIotjA/imagick-3.0.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /tmp/tmpoIotjA/imagick-3.0.0/imagick.c -o imagick.lo
gcc -I. -I/tmp/tmpoIotjA/imagick-3.0.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/imagick-3.0.0/include -I/var/tmp/pear-build-root/imagick-3.0.0/main -I/tmp/tmpoIotjA/imagick-3.0.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /tmp/tmpoIotjA/imagick-3.0.0/imagick.c -fPIC -DPIC -o .libs/imagick.o
/bin/sh /var/tmp/pear-build-root/imagick-3.0.0/libtool --mode=link gcc -DPHP_ATOM_INC -I/var/tmp/pear-build-root/imagick-3.0.0/include -I/var/tmp/pear-build-root/imagick-3.0.0/main -I/tmp/tmpoIotjA/imagick-3.0.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -o imagick.la -export-dynamic -avoid-version -prefer-pic -module -rpath /var/tmp/pear-build-root/imagick-3.0.0/modules imagick_class.lo imagickdraw_class.lo imagickpixel_class.lo imagickpixeliterator_class.lo imagick_helpers.lo imagick_read.lo imagick.lo -lWand -lMagick
gcc -shared .libs/imagick_class.o .libs/imagickdraw_class.o .libs/imagickpixel_class.o .libs/imagickpixeliterator_class.o .libs/imagick_helpers.o .libs/imagick_read.o .libs/imagick.o -lWand -lMagick -Wl,-soname -Wl,imagick.so -o .libs/imagick.so
creating imagick.la
(cd .libs && rm -f imagick.la && ln -s ../imagick.la imagick.la)
/bin/sh /var/tmp/pear-build-root/imagick-3.0.0/libtool --mode=install cp ./imagick.la /var/tmp/pear-build-root/imagick-3.0.0/modules
cp ./.libs/imagick.so /var/tmp/pear-build-root/imagick-3.0.0/modules/imagick.so
cp ./.libs/imagick.lai /var/tmp/pear-build-root/imagick-3.0.0/modules/imagick.la
PATH="$PATH:/sbin" ldconfig -n /var/tmp/pear-build-root/imagick-3.0.0/modules
----------------------------------------------------------------------
Libraries have been installed in:
/var/tmp/pear-build-root/imagick-3.0.0/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 `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'

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

Build complete.
(It is safe to ignore warnings about tempnam and tmpnam).

running: make INSTALL_ROOT="/var/tmp/pear-build-root/install-imagick-3.0.0" install
Installing shared extensions: /var/tmp/pear-build-root/install-imagick-3.0.0/usr/lib64/php/modules/
Installing header files: /var/tmp/pear-build-root/install-imagick-3.0.0/usr/include/php/
running: find "/var/tmp/pear-build-root/install-imagick-3.0.0" -ls
112427559 4 drwxr-xr-x 3 root root 4096 10月 8 23:29 /var/tmp/pear-build-root/install-imagick-3.0.0
112427592 4 drwxr-xr-x 4 root root 4096 10月 8 23:29 /var/tmp/pear-build-root/install-imagick-3.0.0/usr
112427593 4 drwxr-xr-x 3 root root 4096 10月 8 23:29 /var/tmp/pear-build-root/install-imagick-3.0.0/usr/lib64
112427594 4 drwxr-xr-x 3 root root 4096 10月 8 23:29 /var/tmp/pear-build-root/install-imagick-3.0.0/usr/lib64/php
112427595 4 drwxr-xr-x 2 root root 4096 10月 8 23:29 /var/tmp/pear-build-root/install-imagick-3.0.0/usr/lib64/php/modules
112427591 920 -rwxr-xr-x 1 root root 934261 10月 8 23:29 /var/tmp/pear-build-root/install-imagick-3.0.0/usr/lib64/php/modules/imagick.so
112427596 4 drwxr-xr-x 3 root root 4096 10月 8 23:29 /var/tmp/pear-build-root/install-imagick-3.0.0/usr/include
112427597 4 drwxr-xr-x 3 root root 4096 10月 8 23:29 /var/tmp/pear-build-root/install-imagick-3.0.0/usr/include/php
112427598 4 drwxr-xr-x 3 root root 4096 10月 8 23:29 /var/tmp/pear-build-root/install-imagick-3.0.0/usr/include/php/ext
112427599 4 drwxr-xr-x 2 root root 4096 10月 8 23:29 /var/tmp/pear-build-root/install-imagick-3.0.0/usr/include/php/ext/imagick
112427601 28 -rw-r--r-- 1 root root 26690 10月 8 23:29 /var/tmp/pear-build-root/install-imagick-3.0.0/usr/include/php/ext/imagick/php_imagick_defs.h
112427600 4 -rw-r--r-- 1 root root 2476 10月 8 23:29 /var/tmp/pear-build-root/install-imagick-3.0.0/usr/include/php/ext/imagick/php_imagick.h
112427602 4 -rw-r--r-- 1 root root 1828 10月 8 23:29 /var/tmp/pear-build-root/install-imagick-3.0.0/usr/include/php/ext/imagick/php_imagick_shared.h

Build process completed successfully
Installing '/var/tmp/pear-build-root/install-imagick-3.0.0//usr/lib64/php/modules/imagick.so'
Installing '/var/tmp/pear-build-root/install-imagick-3.0.0//usr/include/php/ext/imagick/php_imagick_defs.h'
Installing '/var/tmp/pear-build-root/install-imagick-3.0.0//usr/include/php/ext/imagick/php_imagick.h'
Installing '/var/tmp/pear-build-root/install-imagick-3.0.0//usr/include/php/ext/imagick/php_imagick_shared.h'
install ok: channel://pecl.php.net/imagick-3.0.0
You should add "extension=imagick.so" to php.ini

php.iniに「extension=imagick.so」を追記しなさい、と指示されたので、そうしておく。

[root@nobuneko bin]# ls -ahl /usr/lib64/php/modules/
合計 3.6M
drwxr-xr-x 2 root root 4.0K 10月 8 23:29 .
drwxr-xr-x 5 root root 4.0K 3月 31 2010 ..
-rwxr-xr-x 1 root root 32K 3月 31 2010 dbase.so
-rwxr-xr-x 1 root root 151K 3月 31 2010 dom.so
-rwxr-xr-x 1 root root 330K 3月 31 2010 gd.so
-rwxr-xr-x 1 root root 913K 10月 8 23:54 imagick.so
-rwxr-xr-x 1 root root 1.8M 3月 31 2010 mbstring.so
-rwxr-xr-x 1 root root 91K 3月 31 2010 pdo.so
-rwxr-xr-x 1 root root 28K 3月 31 2010 pdo_pgsql.so
-rwxr-xr-x 1 root root 24K 3月 31 2010 pdo_sqlite.so
-rwxr-xr-x 1 root root 100K 3月 31 2010 pgsql.so
-rwxr-xr-x 1 root root 16K 1月 20 2010 phpcups.so
-rwxr-xr-x 1 root root 26K 3月 31 2010 xmlreader.so
-rwxr-xr-x 1 root root 38K 3月 31 2010 xmlwriter.so
-rwxr-xr-x 1 root root 28K 3月 31 2010 xsl.so

/usr/lib64/php/modules/配下に「imagick.so」というファイルが作成されたことを確認。

[root@nobuneko bin]# /etc/rc.d/init.d/httpd restart
Apacheを再起動。

phpinfoを見ると「imagick」が追記されていることを確認。(以下はphpinfoで確認した設定。)
imagick
imagick module enabled
imagick module version 3.0.0
imagick classes Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator
ImageMagick version ImageMagick 6.2.8 08/25/10 Q16 file:/usr/share/ImageMagick-6.2.8/doc/index.html
ImageMagick copyright Copyright (C) 1999-2006 ImageMagick Studio LLC
ImageMagick release date 08/25/10
ImageMagick number of supported formats: 153
ImageMagick supported formats A, ART, AVI, AVS, B, BMP, BMP2, BMP3, C, CACHE, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CUR, CUT, DCM, DCX, DNG, DOT, DPS, DPX, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, FAX, FITS, FRACTAL, G, G3, GIF, GIF87, GRADIENT, GRAY, HISTOGRAM, HTM, HTML, ICB, ICO, ICON, INFO, JNG, JPEG, JPG, K, LABEL, M, M2V, MAP, MAT, MATTE, MIFF, MNG, MONO, MPC, MPEG, MPG, MSL, MTV, MVG, NULL, O, OTB, OTF, P7, PAL, PALM, PAM, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PFA, PFB, PGM, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG24, PNG32, PNG8, PNM, PPM, PREVIEW, PS, PS2, PS3, PSD, PTIF, PWP, R, RAS, RGB, RGBA, RGBO, RLA, RLE, SCR, SCT, SFW, SGI, SHTML, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, TIFF, TILE, TIM, TTC, TTF, TXT, UIL, UYVY, VDA, VICAR, VID, VIFF, VST, WBMP, WMF, WMZ, WPG, X, XBM, XC, XCF, XPM, XV, XWD, Y, YCbCr, YCbCrA, YUV

Directive Local Value Master Value
imagick.locale_fix 0 0
imagick.progress_monitor 0 0

今後も同様のことが起きたら、きっと今回の回避策を使うのだろうなぁ。

前へ

PostgreSQLで「'」(シングルクォーテーション/単一引用符)をエスケープ処理する方法

次へ

媛彦温泉でボディソープとリンスインシャンプーが無料で利用できるようになっていた