• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • YouClaw
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
百分百
http://www.qrw100.com
博客园    首页    新随笔    联系   管理    订阅  订阅

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/');
    }
}

蟋蟀 发表于 2006-5-31 10:33 AM

这个问题比较难哦.你看看jpgraph.inc.ph文件,还有一个config文件里面有关于文字的定义
一般好象都是FF_什么的.我只在win下用过那东西。

cdxkfc 发表于 2006-5-31 11:31 AM

蟋蟀 老兄,是啊,本地WIN下跑是没有问题的,WIN下字体库都是全的
虚拟主机上就不行了,郁闷
默认字体文件夹根本就没有
有没有知道的高手帮忙啊~~~

[[i] 本帖最后由 cdxkfc 于 2006-5-31 11:32 AM 编辑 [/i]]

catal 发表于 2006-5-31 01:30 PM

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/");
放在这里

cdxkfc 发表于 2006-5-31 03:31 PM

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
郁闷~~~

catal 发表于 2006-5-31 04:38 PM

你有没有看看你字体文件的权限是多少?权限要改到755的

posted @ 2012-04-04 10:08  爱尚美  阅读(581)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3