jeteve has asked for the wisdom of the Perl Monks concerning the following question:
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 !
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: GraphViz , apache
by merlyn (Sage) on Aug 16, 2005 at 16:05 UTC | |
by ikegami (Patriarch) on Aug 16, 2005 at 16:15 UTC | |
by merlyn (Sage) on Aug 16, 2005 at 20:02 UTC | |
by jeteve (Pilgrim) on Aug 16, 2005 at 17:51 UTC | |
by merlyn (Sage) on Aug 16, 2005 at 20:02 UTC | |
by jeteve (Pilgrim) on Aug 17, 2005 at 07:36 UTC | |
|
Re: GraphViz , apache
by Anonymous Monk on Aug 18, 2005 at 05:55 UTC | |
by jeteve (Pilgrim) on Aug 18, 2005 at 08:53 UTC | |
by Anonymous Monk on Aug 23, 2005 at 04:06 UTC | |
|
Re: GraphViz , apache
by jeteve (Pilgrim) on Aug 21, 2006 at 14:29 UTC |