J
James
test.cgi script shown below is adapted from the "CGI programming" book
(chap.13).
There's no problem with installation of GD module and generation of PNG
file.
However, on the web, it gives the following error.
Is this a script error, or apache2 configuration error?
============================
Server error!
The server encountered an internal error and was unable to complete
your request.
Error message:
Premature end of script headers: test.cgi
============================
$ cat test.cgi
use CGI;
use GD::Graph::bars;
$cgi = new CGI;
$g = new GD::Graph::bars;
@data = ( [qw(A B C D E F)], [qw(1 2 3 4 5 6)] );
$g->set(
x_label => 'X',
y_label => 'Y',
title => 'TITLE',
show_values => \@data
);
$graph = $g->plot(\@data);
print $cgi->header( -type => 'image/png', -expires => '-1d' );
binmode STDOUT;
print $graph->png;
============================
Any help would be greatly appreciated.
James
(chap.13).
There's no problem with installation of GD module and generation of PNG
file.
However, on the web, it gives the following error.
Is this a script error, or apache2 configuration error?
============================
Server error!
The server encountered an internal error and was unable to complete
your request.
Error message:
Premature end of script headers: test.cgi
============================
$ cat test.cgi
use CGI;
use GD::Graph::bars;
$cgi = new CGI;
$g = new GD::Graph::bars;
@data = ( [qw(A B C D E F)], [qw(1 2 3 4 5 6)] );
$g->set(
x_label => 'X',
y_label => 'Y',
title => 'TITLE',
show_values => \@data
);
$graph = $g->plot(\@data);
print $cgi->header( -type => 'image/png', -expires => '-1d' );
binmode STDOUT;
print $graph->png;
============================
Any help would be greatly appreciated.
James