JPGraph Error
I asked a colleague of mine to set up a PHP-Syslog-NG (http://code.google.com/p/php-syslog-ng/) as the central logging system of all our devices and servers. He did this on a FreeBSD 7.0 and everything started working fine but the "Graph" section which works with JPGraph couldn't draw any Graphs and it came up with this message: "JpGraph Error Font file "/usr/share/fonts/truetype/msttcorefonts/verdana.ttf" is not readable or does not exist..
After some digging into the codes and configs I got over the problem following the bellow steps:
- Install TrueType font on FreeBSD (XfStt).
- Fetch the "verdana.ttf" font and place it in the directory that XfStt created for TrueType fonts.
- Change the default "TTF_DIR" parameter.
An easy way to use TrueType fonts in BSD is to install XfStt which is available through ports collection at "/usr/ports/x11-servers/Xfstt/".
After the installation a directory will be created for TrueType fonts at "/usr/local/lib/X11/fonts/TrueType/".
Step 2:
downloading verdana.ttf and placing it in "/usr/local/lib/X11/fonts/TrueType/".
I fetched my copy from "http://www.afosteo.org/Download/Fonts/"
Step 3:
The final step is to point JPgraph TTF_DIR parameter inside the jpg-config.inc configuration file to to proper location.
jpg-config.inc is located at "/usr/svr/php-syslog-ng/html/includes/jpgraph"
Labels: Linux, Monitoring, Protocols, Security



4 Comments:
I just had the same problem with Jpgraph in Debian, setting up LogZilla. Two reasons for failure: Jpgraph looks for fonts that dont exist, Debian Lenny does not provide verdana.ttf font file (in any package).
Solution: (for Debian Lenny)
as root:
mkdir /usr/share/fonts/truetype/msttcorefonts
visit http://www.afosteo.org/Download/Fonts/ and download verdana.ttf, copy it to last created folder.
Re-load Logzilla/Jpgraph page - should work OK.
This will not fix the general problem of Debian Lenny not having the msttcorefonts - I'm still waiting on an easy fix for that.
Cheers,
Mike
This post has been removed by the author.
This post has been removed by the author.
1. apt-get install msttcorefonts
2.vim /var/www/jpgraph-2.3/src/jpg-config.inc.php
DEFINE("TTF_DIR","/usr/share/fonts/truetype/msttcorefonts/");
3. /etc/init.d/apache2 restart
Post a Comment
<< Home