码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2018-03-18 22:27:31      阅读:291      评论:0      收藏:0      [点我收藏+]

标签:php5.5.32安装图形插件遇到的坑

插件,调用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报错如下:
[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扩展插件遇到的坑

标签:php5.5.32安装图形插件遇到的坑

原文地址:http://blog.51cto.com/sandshell/2088272

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!