jpgraph中文乱码

来源:互联网 发布:球球大作战辅助软件 编辑:程序博客网 时间:2024/04/30 10:29
1.把字体文件(C:\WINDOWS/fonts/)fonts复制到存放jpgraph的相同文件下面。
2.在jpgraph.php里找到如下代码
// Setup path for western/latin TTF fonts
if (!defined('TTF_DIR')) {
if (strstr( PHP_OS, 'WIN') ) {
$sroot = getenv('SystemRoot');
if( empty($sroot) ) {
$t = new ErrMsgText();
$msg = $t->Get(12,$file,$lineno);
die($msg);
}
else {
define('TTF_DIR', $sroot.'/fonts/');
}
} else {
define('TTF_DIR','/usr/share/fonts/truetype/');
}
}
修改为:
// Setup path for western/latin TTF fonts
//
if (!defined('TTF_DIR')) {
if (strstr( PHP_OS, 'WIN') ) {
$sroot = getenv('SystemRoot');
if( empty($sroot) ) {
$t = new ErrMsgText();
$msg = $t->Get(12,$file,$lineno);
die($msg);
}
else {
define('TTF_DIR','jpgraph/fonts/');
}
} else {
define('TTF_DIR','/usr/share/fonts/truetype/');
}
}

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(C:\WINDOWS/fonts/simhei.ttf) is not within the allowed path(s): (e:/DedeAMPZ/WebRoot/hm5988comcn) in E:\DedeAMPZ\WebRoot\hm5988comcn\api\src\jpgraph\jpgraph_ttf.inc.php on line 497
JpGraph Error: 25049 Font file "C:\WINDOWS/fonts/simhei.ttf" is not readable or does not exist.


原创粉丝点击