|
From: Jingzhao Ou <ja...@ya...> - 2005-02-23 01:11:22
|
Dear all, I installed Gnuplot 4.0 on a RedHat Linux box. It seems to be working fine from the bash command line. I planned to use Gnuplot for online plotting, some thing like what is showing on the following URL: http://www.srcf.ucam.org/~sea31/ I ran a gnuplot script test.dem on PHP as the following: system("gnuplot test.dem"); However, I failed to get any output from Gnuplot even though running "gnuplot test.dem" directly in the bash command line would give me the desired result. I tried also CGI written in Perl. I can run the Perl script on the bash command line and generate the desired ps file. However, when I run it through CGI, I got nothing! I searched Google. It seems that quite some people encountered similar problems. But I failed to find out the answers to the question. Can any one kindly give me a hand! Thanks a lot for your help!!! Best regards, Jingzhao |
|
From: Ethan M. <merritt@u.washington.edu> - 2005-02-23 01:29:59
|
On Tuesday 22 February 2005 05:11 pm, Jingzhao Ou wrote:
>
> I installed Gnuplot 4.0 on a RedHat Linux box. It seems to be working fine from
> the bash command line.
OK
> I ran a gnuplot script test.dem on PHP as the following:
>
> system("gnuplot test.dem");
>
> However, I failed to get any output from Gnuplot even though running "gnuplot
> test.dem" directly in the bash command line would give me the desired result. I
> tried also CGI written in Perl. I can run the Perl script on the bash command
> line and generate the desired ps file. However, when I run it through CGI, I
> got nothing!
It would help if you showed us the gnuplot script itself.
Does your http daemon have write access to the directory where
you are trying to create a postscript file?
Are there error messages in the http daemon's error log file?
Does the 'test.dem' script refer to any data files, and if so are they
in the daemon's default directory?
And a separate comment:
Postscript is probably the wrong output format for displaying on a web page.
Have you considered creating a PNG image instead, or emitting in-line
SVG code as part of a dynamic http document?
> Can any one kindly give me a hand! Thanks a lot for your help!!!
Here is a fragment from a working perl-script in daily use on my web site:
open(GNUPLOT,">$tempfile.gnu");
if ($y_fixed eq "on") { print GNUPLOT " set yrange [0:$y_range]\n" ; }
print GNUPLOT <<EOFgnu;
set data style linespoints
set style line 1 lt -1 lw 3 pt 7
set style line 2 lt 3 lw 3 pt 9
set style line 3 lt 1 lw 3 pt 5
set style line 4 lt 4 lw 3 pt 6
set title 'Distribution of anisotropy by atom class'
set xlabel 'Anisotropy'
set ylabel 'Fraction of atoms' -1
set label '$PLOT_LABEL' at graph 0.025, graph 0.95 left
set format y '%4.2f'
set size 1.00, 1.00
set term png $png_options
set output '$tempfile.png'
plot $proteinplot
$naplot
$solventplot
$hetatmplot
EOFgnu
close(GNUPLOT);
--
Ethan A Merritt merritt@u.washington.edu
Biomolecular Structure Center
Mailstop 357742
University of Washington, Seattle, WA 98195
|
|
From: Ethan M. <merritt@u.washington.edu> - 2005-02-23 03:12:44
|
On Tuesday 22 February 2005 05:29 pm, Ethan Merritt wrote: > > Here is a fragment from a working perl-script in daily use on my web > site: for which I forgot the opening and final commands.... $gnuplot = '/usr/local/bin/gnuplot'; > open(GNUPLOT,">$tempfile.gnu"); ... > close(GNUPLOT); system "$gnuplot $tempfile.gnu" ; -- Ethan A Merritt Biomolecular Structure Center University of Washington 98195-7742 |
|
From: Jingzhao Ou <ja...@ya...> - 2005-02-23 04:47:36
|
Dear Ethan, Thanks a lot for your useful information. I figured out the reason from your second email. I forgot to use the full path name for gnuplot. Sorry for my silly mistake. Now, every thing becomes perfect again!!! :-) Best regards, Jingzhao --- Ethan Merritt <merritt@u.washington.edu> wrote: > On Tuesday 22 February 2005 05:29 pm, Ethan Merritt wrote: > > > > Here is a fragment from a working perl-script in daily use on my web > > site: > > for which I forgot the opening and final commands.... > > $gnuplot = '/usr/local/bin/gnuplot'; > > > open(GNUPLOT,">$tempfile.gnu"); > ... > > close(GNUPLOT); > > system "$gnuplot $tempfile.gnu" ; > > -- > Ethan A Merritt > Biomolecular Structure Center > University of Washington 98195-7742 |
|
From: Jonathan T. <jt...@ae...> - 2005-03-01 13:38:37
|
Hi, You wrote > I planned to use Gnuplot for online plotting, some thing like what is showing > on the following URL: > > http://www.srcf.ucam.org/~sea31/ I'd just like to warn you that gnuplot is almost certainly *not* secure against malicious inputs. That is, it is very likely that malicious commands could crash or buffer-overflow gnuplot. You sould look very carefully at the security risks of allowing untrusted people to provide gnuplot commands -- they might well be able to take over control of the gnuplot process and use it for malicious purposes. ciao, -- -- Jonathan Thornburg <jt...@ae...> Max-Planck-Institut fuer Gravitationsphysik (Albert-Einstein-Institut), Golm, Germany, "Old Europe" http://www.aei.mpg.de/~jthorn/home.html "Washing one's hands of the conflict between the powerful and the powerless means to side with the powerful, not to be neutral." -- quote by Freire / poster by Oxfam |
|
From: Jingzhao Ou <ja...@ya...> - 2005-03-02 17:22:15
|
Hi, Jonathan, Thanks a lot for your warning. I am going to invoke Gunplot indirectly through another numerical processing program. So, hope that it will be safe enough. :-) Best regards, Jingzhao --- Jonathan Thornburg <jt...@ae...> wrote: > Hi, > > You wrote > > I planned to use Gnuplot for online plotting, some thing like what is > showing > > on the following URL: > > > > http://www.srcf.ucam.org/~sea31/ > > I'd just like to warn you that gnuplot is almost certainly *not* > secure against malicious inputs. That is, it is very likely that > malicious commands could crash or buffer-overflow gnuplot. You sould > look very carefully at the security risks of allowing untrusted people > to provide gnuplot commands -- they might well be able to take over > control of the gnuplot process and use it for malicious purposes. > > ciao, |