歡迎您光臨本站 註冊首頁

centos 5.5 64 php imagick 模塊錯誤處理記錄

←手機掃碼閱讀     火星人 @ 2014-03-08 , reply:0

報錯: Uncaught exception 'ImagickException' with message 'Unable to annotate image'

使用phpinfo 函數檢查時,正常.但php代碼調用時,出現如上報錯,或者讀取不了字體,去掉字體就出現上面的報錯了.

原因:和 /usr/share/fonts 下字體有關

字體目錄 /usr/share/fonts ImageMagick 配置字體 /usr/local/lib/ImageMagick-6.5.1/config/type-ghostscript.xml ,若系統在字體目錄下只有 bitstream-vera ,導致type-ghostscript.xml 配置中獲取字體路徑沒有 如: <type name="AvantGarde-Book" fullname="AvantGarde Book" family="AvantGarde" foundry="URW" weight="400" style="normal" stretch="normal" format="type1" metrics="a010013l.afm" glyphs="a010013l.pfb"/> 正常的應該是: <type name="AvantGarde-Book" fullname="AvantGarde Book" family="AvantGarde" foundry="URW" weight="400" style="normal" stretch="normal" format="type1" metrics="/usr/share/fonts /default/Type1/a010013l.afm" glyphs="/usr/share/fonts/default/Type1/a010013l.pfb"/>
解決方法: 1、安裝系統原有字體相關包:yum -y install 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 .

本文出自 「風中人生」 博客,謝絕轉載!


[火星人 ] centos 5.5 64 php imagick 模塊錯誤處理記錄已經有291次圍觀

http://coctec.com/docs/linux/show-post-46803.html