php5.5.32编译安装imagick-2.3.0php扩展插件遇到的坑

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php5.5.32编译安装imagick-2.3.0php扩展插件遇到的坑相关的知识,希望对你有一定的参考价值。

插件,调用ImageMagick图形处理软件,必须图形处理软件先安装才可以安装此插件,否则报错。
到pecl.php.net下载源代码包。地址http://pecl.php.net/package/imagick

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报错如下:
[[email protected] 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
[[email protected] 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扩展插件遇到的坑的主要内容,如果未能解决你的问题,请参考以下文章

php安装

php安装

php安装imagemagick问题。

安装 imagick

pecl install imagick

checking ImageMagick MagickWand API configuration program... configure: error: