Found a solution!! : GraphViz needs a HOME environment variable. A SetEnv HOME /tmp/ (for instance) in apache conf fixed the problem. Actually it was written in the GraphViz FAQ about the same problem under debian.
Therefore, I deeply apologize for the time you worried about this problem.
The problem is the image /tmp/img/jpeg is zero sized. When the GraphViz code is ran from the command line, it works perfectly.My conf: GraphViz 2.02 uname -a Linux -- 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/L +inux Apache/2.0.40 perl v5.8.0 built for i386-linux-thread-multi Here is my CGI: #! /usr/bin/perl -w use GraphViz; use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser); my $g = GraphViz->new( directed => 0 ); my $europe = { name =>'Europe', style =>'filled', fillcolor =>'lightgray', fontname =>'arial', fontsize =>'12' }; $g->add_node('London' , shape => 'hexagon' , URL => 'http://www.eteve. +net/', cluster=> $europe ); $g->add_node('Paris', cluster => $europe ); $g->add_node('New York'); $g->add_node('LA', label => '' , style => 'invis' , height => 0 , width => 0 , shape => 'circle' , ); $g->add_node('Amsterdam', cluster => $europe); $g->add_edge('London' => 'Paris'); $g->add_edge('London' => 'New York', label => 'Far'); $g->add_edge('Paris' => 'LA' , label => 'Very far'); $g->add_edge('LA', 'New York', label => 'Not so far'); $g->add_edge('Paris' => 'London' ,minlen => 0 , weight => 100 ); open IMG , ">/tmp/img.jpg"; binmode IMG ; print IMG $g->as_jpeg; close IMG ;
-- Nice photos of naked perl sources here !
In reply to GraphViz , apache by jeteve
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |