[R] CGIwithR

Duncan Temple Lang duncan at wald.ucdavis.edu
Sun Feb 4 14:47:01 CET 2007


You should look in the log files from apache for error messages,
specifically the error.log file (typically).


If you are getting no output, the code in the
R script is most likely generating an error
before it creates any output.

So you can have it output information about what it is doing.
There is a variable  verbose  that you can set to
TRUE to have information displayed about the computations
and inputs which might help.

The better way to debug is to use dump.frames.
In the script, put near the top
options(error =
   quote({dump.frames("cgi_error", to.file = TRUE);q()}))

Then, after the script has been run,
start R in the cgi-bin directory and use

load("cgi_error.rda")
debugger(cgi_error)


  D

Aimin Yan wrote:
> 
> Yes, I already read it. I want to try those examples out.
> The question for bootstarpFile.html is:
> 
> when I give several number , and press Submit Query.
> I didn't get any output.
> 
> here is the location of my file
> 
> [root at omega cgi-bin]# pwd
> /var/www/cgi-bin
> [root at omega cgi-bin]# ls -al
> total 68
> drwxr-xr-x  2 root root 4096 Feb  3 16:38 .
> drwxrwxrwx  8 root root 4096 Jan 10 12:24 ..
> -rw-r--r--  1 root root 2219 Feb  2 15:09 bootstrap.R
> -rw-r--r--  1 root root  479 Feb  2 15:48 data.R
> -rw-r--r--  1 root root 3339 Feb  2 15:15 qvweb.R
> -rwxr-xr-x  1 root root 4641 Feb  2 15:42 R.cgi
> -rw-r--r--  1 root root   41 Feb  2 15:43 .Rprofile
> -rw-r--r--  1 root root 1334 Feb  2 15:46 trivial.R
> 
> [root at omega html]# pwd
> /var/www/html
> [root at omega html]# ls -al
> total 48
> drwxrwxrwx  2 root   root   4096 Feb  2 15:52 .
> drwxrwxrwx  8 root   root   4096 Jan 10 12:24 ..
> -rw-rw-r--  1 aiminy aiminy 1737 Feb  2 15:52 bootstrapFile.html
> -rw-rw-r--  1 aiminy aiminy 1682 Feb  2 14:24 bootstrap.html
> -rw-rw-r--  1 aiminy aiminy  904 Jan 10 12:41 course.html
> -rw-rw-r--  1 aiminy aiminy  548 Feb  2 15:46 trivial.html



More information about the R-help mailing list