jpgraph在linux主机下安装时候遇到的问题
jpgraph在linux主机下安装时候遇到的问题
运行文件出现
font file "/usr/X11R6/lib/X11/fonts/truetype/simhei.ttf" is not readable or does not exist
不知道大家遇到过这个问题吗
虚拟主机上就没有X11R6 这个文件夹
后来我从XP上找到simhei.ttfCOPY到新建的 "/usr/X11R6/lib/X11/fonts/truetype/下,还是没有问,文件属性可读!
jpgraph.php部分配置说明:
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/X11R6/lib/X11/fonts/truetype/');
}
}
这个问题比较难哦.你看看jpgraph.inc.ph文件,还有一个config文件里面有关于文字的定义
一般好象都是FF_什么的.我只在win下用过那东西。
蟋蟀 老兄,是啊,本地WIN下跑是没有问题的,WIN下字体库都是全的
虚拟主机上就不行了,郁闷
默认字体文件夹根本就没有
有没有知道的高手帮忙啊~~~
[[i] 本帖最后由 cdxkfc 于 2006-5-31 11:32 AM 编辑 [/i]]
jpgraph字体的配置路径应该在jpg-config.inc.php文件配置
/------------------------------------------------------------------------
// Directories for cache and font directory.
//
// CACHE_DIR:
// The full absolute name of the directory to be used to store the
// cached image files. This directory will not be used if the USE_CACHE
// define (further down) is false. If you enable the cache please note that
// this directory MUST be readable and writable for the process running PHP.
// Must end with '/'
//
// TTF_DIR:
// Directory where TTF fonts can be found. Must end with '/'
//
// The default values used if these defines are left commented out are:
//
// UNIX:
// CACHE_DIR /tmp/jpgraph_cache/
// TTF_DIR /usr/X11R6/lib/X11/fonts/TTF/
// MBTTF_DIR /usr/share/fonts/ja/TrueType/
//
// WINDOWS:
// CACHE_DIR $SERVER_TEMP/jpgraph_cache/
// TTF_DIR $SERVER_SYSTEMROOT/fonts/
// MBTTF_DIR $SERVER_SYSTEMROOT/fonts/
//
//------------------------------------------------------------------------
// DEFINE("CACHE_DIR","/tmp/jpgraph_cache/");
DEFINE("TTF_DIR","/usr/X11R6/lib/X11/fonts/TTF/");
DEFINE("MBTTF_DIR","/usr/share/fonts/ja/TrueType/");
放在这里
DEFINE("TTF_DIR","/usr/X11R6/lib/X11/fonts/TTF/");
虚拟主机上面没有X11
我改成 DEFINE("TTF_DIR","/httpdocs/");
把 simhei.ttf 放到httpdocs里面
可是警告还是 :font file "/httpdocs/simhei.ttf" is not readable or does not exist
郁闷~~~
你有没有看看你字体文件的权限是多少?权限要改到755的

浙公网安备 33010602011771号