赞
踩
解决方案一:重新编译php,并取消 --enable-gd-jis-conv 这个参数
1.保留之前的php目录更换名称
2.在已安装php的bin目录下执行./php -i|grep “configure” 看到php安装的编译参数,直接照样子在php的编译环境下执行执行编译,并去除–enable-gd-jis-conv
3.然后执行 make && make install
4.复制之前php中的相关信息到新编译的php中并进行重启
解决方案二:
对字符串进行to_entities处理
function to_entities($string){ $len = strlen($string); $buf = ""; for($i = 0; $i < $len; $i++){ if (ord($string[$i]) <= 127){ $buf .= $string[$i]; } else if (ord ($string[$i]) <192){ //unexpected 2nd, 3rd or 4th byte $buf .= "�"; } else if (ord ($string[$i]) <224){ //first byte of 2-byte seq $buf .= sprintf("&#%d;", ((ord($string[$i + 0]) & 31) << 6) + (ord($string[$i + 1]) & 63) ); $i += 1; } else if (ord ($string[$i]) <240){ //first byte of 3-byte seq $buf .= sprintf("&#%d;", ((ord($string[$i + 0]) & 15) << 12) + ((ord($string[$i + 1]) & 63) << 6) + (ord($string[$i + 2]) & 63) ); $i += 2; } else { //first byte of 4-byte seq $buf .= sprintf("&#%d;", ((ord($string[$i + 0]) & 7) << 18) + ((ord($string[$i + 1]) & 63) << 12) + ((ord($string[$i + 2]) & 63) << 6) + (ord($string[$i + 3]) & 63) ); $i += 3; } } return $buf; } imagettftext($im, 11, 0, 5, 11, $black, $font, to_entities($text));
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。