Subject: plot2d in Lisp CGI (was: plot2d output "")
From: Yigal Asnis
Date: Wed, 19 Sep 2007 00:08:20 -0700 (PDT)
The error in Apache log is "UNIX error 13 (EACCES): Permission denied".
I tryed to run the script from a console:
If I log in as root, there is no problem - plot is created.
If I log in as non-root (my regulary user "yigal") I get the same error as in Apache log above.
I checked the permissions of gnuplot - it can be executed by everyone.
I tryed to create output file in directory that everyone can write in : [gnuplot_out_file "/tmp/outfile.ps"], but still have the same error.
Finally, I runned
clisp -M -maxima.mem
from my non-root-user terminal (usually I use root terminal) and tryed
#$plot2d (sin(x), [x,-1,1], [gnuplot_term, ps], [gnuplot_out_file "/tmp/outfile.ps"])$
and still have the same error!
What else can be wrong with permissions?
Andrej Vodopivec <andrej.vodopivec at gmail.com> wrote: On 9/18/07, Rupert Swarbrick wrote:
> On Mon, 17 Sep 2007 13:17:21 -0700 (PDT)
> Yigal Asnis wrote:
>
> > It turns out that return value of plot2d ("") wasn't
> > problem. I suppressed it by (progn #$plot2d(...)$
> > (princ "something I need to print")) but CGI program
> > still stuck.
> > If I execute the CGI file from terminal, it works -
> > plot2d generates plot file and all other output work
> > as expected.
> > But if I point to CGI file with browser, the plot file
> > isn't generated and all commands after plot2d aren't
> > executed.
> > I think the problem is calling external function
> > (gnuplot) from CGI.
> > I use Apache with mod_cgi on Debian.
> >
> > Yigal Asnis
>
> Are you on *nix?
>
> I don't know much at all about cgi programming in general or with
> gnuplot in particular, but maybe there's a problem because gnuplot is
> an X11 program?
>
> In particular, try running some random X11 program (gnuplot,xeyes ?)
> from a console (Ctrl-Alt-F1) on Linux and you'll get a 5 sec. or so
> wait followed by an error message complaining that it was unable to
> communicate with the X server (because the DISPLAY variable was not set
> and it doesn't know who to ask).
>
> Running from Apache as a CGI script, your program might have a similar
> problem. Have you tried running your CGI script via a proper console? I
> think that would show whether this is the problem.
gnuplot does not require X to be running. The following produces a ps
file even from console (you need to set the plot_format to gnuplot,
the default gnuplot_pipes does not work for me).
plot2d(sin(x), [x,-5,5], [plot_format, gnuplot], [gnuplot_term, ps]);
HTH,
--
Andrej
_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima
Yigal Asnis
need to solve math problems for the school - try my site (in hebrew)
math-tool.co.il
---------------------------------
Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us.