PHP ImageMagick 확장 모듈설치

1. ImageMagick 패키지 설치

 

[root@localhost bin]# yum install ImageMagick ImageMagick-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.daum.net
* extras: ftp.daum.net
* updates: ftp.daum.net
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package ImageMagick.i386 0:6.2.8.0-15.el5_8 set to be updated
—> Package ImageMagick.x86_64 0:6.2.8.0-15.el5_8 set to be updated
—> Package ImageMagick-devel.i386 0:6.2.8.0-15.el5_8 set to be updated
—> Package ImageMagick-devel.x86_64 0:6.2.8.0-15.el5_8 set to be updated
–> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================
Installing:
ImageMagick i386 6.2.8.0-15.el5_8 updates 3.3 M
ImageMagick x86_64 6.2.8.0-15.el5_8 updates 3.3 M
ImageMagick-devel i386 6.2.8.0-15.el5_8 updates 76 k
ImageMagick-devel x86_64 6.2.8.0-15.el5_8 updates 76 k

Transaction Summary
=============================================================================================================================
Install 4 Package(s)
Upgrade 0 Package(s)

Total download size: 6.7 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): ImageMagick-devel-6.2.8.0-15.el5_8.i386.rpm | 76 kB 00:00
(2/4): ImageMagick-devel-6.2.8.0-15.el5_8.x86_64.rpm | 76 kB 00:00
(3/4): ImageMagick-6.2.8.0-15.el5_8.i386.rpm | 3.3 MB 00:00
(4/4): ImageMagick-6.2.8.0-15.el5_8.x86_64.rpm | 3.3 MB 00:00
—————————————————————————————————————————–
Total 7.8 MB/s | 6.7 MB 00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : ImageMagick 1/4
Installing : ImageMagick 2/4
Installing : ImageMagick-devel 3/4
Installing : ImageMagick-devel 4/4

Installed:
ImageMagick.i386 0:6.2.8.0-15.el5_8 ImageMagick.x86_64 0:6.2.8.0-15.el5_8
ImageMagick-devel.i386 0:6.2.8.0-15.el5_8 ImageMagick-devel.x86_64 0:6.2.8.0-15.el5_8

Complete!

 

 

 

2. pecl 명령으로 imagick 확장 모듈 설치

[root@localhost bin]# ./pecl install imagick
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
WARNING: php_bin /usr/local/php/bin/php appears to have a suffix /bin/php, but config variable php_suffix does not match
running: phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
Please provide the prefix of Imagemagick installation [autodetect] :
building in /var/tmp/pear-build-root/imagick-3.0.1
running: /tmp/pear/temp/imagick/configure –with-imagick
checking for egrep… grep -E
checking for a sed that does not truncate output… /bin/sed
checking for cc… cc
checking for C compiler default output file name… a.out

~

 

6784781 4 drwxr-xr-x 3 root root 4096 Jan 17 10:19 /var/tmp/pear-build-root/install-imagick-3.0.1/usr/local/php/lib
6784782 4 drwxr-xr-x 3 root root 4096 Jan 17 10:19 /var/tmp/pear-build-root/install-imagick-3.0.1/usr/local/php/lib/php
6784783 4 drwxr-xr-x 3 root root 4096 Jan 17 10:19 /var/tmp/pear-build-root/install-imagick-3.0.1/usr/local/php/lib/php/extensions
6784784 4 drwxr-xr-x 2 root root 4096 Jan 17 10:19 /var/tmp/pear-build-root/install-imagick-3.0.1/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613
6784777 928 -rwxr-xr-x 1 root root 944277 Jan 17 10:19 /var/tmp/pear-build-root/install-imagick-3.0.1/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/imagick.so

Build process completed successfully
Installing ‘/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/imagick.so
Installing ‘/usr/local/php/include/php/ext/imagick/php_imagick_defs.h’
Installing ‘/usr/local/php/include/php/ext/imagick/php_imagick_shared.h’
Installing ‘/usr/local/php/include/php/ext/imagick/php_imagick.h’
install ok: channel://pecl.php.net/imagick-3.0.1
configuration option “php_ini” is not set to php.ini location
You should add “extension=imagick.so” to php.ini
[root@localhost bin]#

 

 

 

3. php.ini 파일에 extension_dir 및 extension 추가

 

extension_dir = “/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613”
extension=imagick.so

 

 

 

4. apache 데몬 restart 및 모듈 확인

 

[root@localhost ~]# /usr/local/apache2/bin/apachectl restart
[root@localhost ~]# /usr/local/php/bin/php -i | grep -i imagick
imagick
imagick module => enabled
imagick module version => 3.0.1
imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator
imagick.locale_fix => 0 => 0
imagick.progress_monitor => 0 => 0
[root@localhost ~]#