我在我的本地服务器上安装了ImageMagick,它工作得很好。但当我转向webfaction,并尝试在服务器上安装它时,我遇到了问题。 ImageMagick安装在服务器上,但我无法安装php扩展imagick。我按照步骤从http://pecl.php.net/get/imagick-3.0.1.tgz下载了tar文件。然后我解压缩文件及其内容并进行配置。我也做了phpize。但是当我确实犯了以下错误时:
[e@web308 imagick-3.0.1]$ make /bin/sh /home/e/temp/imagick-3.0.1/libtool --mode=compile cc -I. -I/home/e/temp/imagick-3.0.1 -DPHP_ATOM_INC -I/home/e/temp/imagick-3.0.1/include -I/home/e/temp/imagick-3.0.1/main -I/home/e/temp/imagick-3.0.1 -I/usr/local/include/php54 -I/usr/local/include/php54/main -I/usr/local/include/php54/TSRM -I/usr/local/include/php54/Zend -I/usr/local/include/php54/ext -I/usr/local/include/php54/ext/date/lib -I/usr/include/ImageMagick -DHAVE_CONFIG_H -g -O2 -c /home/e/temp/imagick-3.0.1/imagick_class.c -o imagick_class.lo mkdir .libs cc -I. -I/home/e/temp/imagick-3.0.1 -DPHP_ATOM_INC -I/home/e/temp/imagick-3.0.1/include -I/home/e/temp/imagick-3.0.1/main -I/home/e/temp/imagick-3.0.1 -I/usr/local/include/php54 -I/usr/local/include/php54/main -I/usr/local/include/php54/TSRM -I/usr/local/include/php54/Zend -I/usr/local/include/php54/ext -I/usr/local/include/php54/ext/date/lib -I/usr/include/ImageMagick -DHAVE_CONFIG_H -g -O2 -c /home/e/temp/imagick-3.0.1/imagick_class.c -fPIC -DPIC -o .libs/imagick_class.o /home/e/temp/imagick-3.0.1/imagick_class.c: In function ‘zim_imagick_setfont’: /home/e/temp/imagick-3.0.1/imagick_class.c:1442: error: ‘struct _php_core_globals’ has no member named ‘safe_mode’ /home/e/temp/imagick-3.0.1/imagick_class.c:1442: error: ‘CHECKUID_CHECK_FILE_AND_DIR’ undeclared (first use in this function) /home/e/temp/imagick-3.0.1/imagick_class.c:1442: error: (Each undeclared identifier is reported only once /home/e/temp/imagick-3.0.1/imagick_class.c:1442: error: for each function it appears in.) /home/e/temp/imagick-3.0.1/imagick_class.c:1442: error: ‘CHECKUID_NO_ERRORS’ undeclared (first use in this function) /home/e/temp/imagick-3.0.1/imagick_class.c: In function ‘zim_imagick_setimageprogressmonitor’: /home/e/temp/imagick-3.0.1/imagick_class.c:9534: error: ‘struct _php_core_globals’ has no member named ‘safe_mode’ /home/e/temp/imagick-3.0.1/imagick_class.c:9534: error: ‘CHECKUID_CHECK_FILE_AND_DIR’ undeclared (first use in this function) /home/e/temp/imagick-3.0.1/imagick_class.c:9534: error: ‘CHECKUID_NO_ERRORS’ undeclared (first use in this function) make: *** [imagick_class.lo] Error 1
它说一些变量是未申报的。我试过其他版本并得到同样的错误。
在这里我可能做错了什么帮助?
提前致谢。
答案 0 :(得分:4)
PHP54不适用于3.0.1版,您可以使用最新版本来解决此问题:
wget http://pecl.php.net/get/imagick-3.1.0RC2.tgz tar xzvf imagick-3.1.0RC2.tgz cd imagick-3.1.0RC2 phpize ./configure make cp modules/imagick.so /your-php-extensions-directory-path/
答案 1 :(得分:0)
解决方案是安装模块的beta版本:
pear config-set preferred_state beta
pecl install imagick