php5.5不支持 imagick-2.3.0.tgz会报错
wget -q http://pecl.php.net/get/imagick-2.3.0.tgz
tar zxf imagick-2.3.0.tgz
cd imagick-2.3.0
/application/php/bin/phpize
./configure --with-php-config=/application/php/bin/php-config --with-imagick=/usr/local/ImageMagick
make报错如下:
[root@web01 imagick-2.3.0]# make
/home/oldboy/tools/imagick-2.3.0/imagick_class.c: In function ‘zim_imagick_setimageprogressmonitor‘:
/home/oldboy/tools/imagick-2.3.0/imagick_class.c:9483: error: ‘struct _php_core_globals‘ has no member named ‘safe_mode‘
/home/oldboy/tools/imagick-2.3.0/imagick_class.c:9483: error: ‘CHECKUID_CHECK_FILE_AND_DIR‘ undeclared (first use in this function)
/home/oldboy/tools/imagick-2.3.0/imagick_class.c:9483: error: ‘CHECKUID_NO_ERRORS‘ undeclared (first use in this function)
make: *** [imagick_class.lo] Error 1
下载支持php5.5的imagick-3.1.2.tgz
http://pecl.php.net/package/imagick
cd /home/oldboy/tools
rz -y #上传imagick-3.1.2.tgz
tar xf imagick-3.1.2.tgz
cd imagick-3.1.2
/application/php/bin/phpize
./configure --with-php-config=/application/php/bin/php-config --with-imagick=/usr/local/ImageMagick
make
make install
[root@web01 imagick-3.1.2]# ll /application/php5.5.32/lib/php/extensions/no-debug-non-zts-20121212/
total 2716
-rwxr-xr-x 1 root root 1114692 Mar 18 21:37 imagick.so
-rwxr-xr-x 1 root root 258088 Mar 1 10:50 memcache.so
-rwxr-xr-x 1 root root 543497 Mar 18 18:41 opcache.so
-rwxr-xr-x 1 root root 158884 Mar 18 20:02 pdo_mysql.so
-rwxr-xr-x 1 root root 692884 Mar 18 18:19 xcache.so
imagick.so安装ok
总结:php版本对于imagick是有要求的。
php5.5.32编译安装imagick-2.3.0php扩展插件遇到的坑
原文地址:http://blog.51cto.com/sandshell/2088272