centos 5.5 64 php imagick 模块错误处理记录
报错: Uncaught exception 'ImagickException' with message 'Unable to annotate image'使用phpinfo 函数检查时,正常。但php代码调用时,出现如上报错,或者读取不了字体,去掉字体就出现上面的报错了。
原因:和 /usr/share/fonts下字体有关
字体目录 /usr/share/fonts
http://blog.运维网.com/attachment/201201/192044643.jpg
ImageMagick配置字体/usr/local/lib/ImageMagick-6.5.1/config/type-ghostscript.xml,若系统在字体目录下只有bitstream-vera,导致type-ghostscript.xml 配置中获取字体路径没有
如:
正常的应该是:
解决方法:
1、安装系统原有字体相关包:yum -yinstall bitmap-fonts xorg-x11-fonts-Type1 libfontenc bitstream-vera-fonts xorg-x11-fonts-base xorg-x11-font-utils urw-fonts fontconfig libXfont libXfontcache chkfontpath
2、重新编译 ImageMagick和 imagick 。
页:
[1]