[R] X11 connection error in web cgi mode only

vfasciani vfasciani at micron.com
Wed Mar 19 11:35:31 CET 2003

According to my sysadmin I post his answer for all useRs.


Vittorio Paolo Fasciani
Operation Software Technician
Micron Technology Italia
vfasciani at micron.com

-----Original Message-----
From: eboriani 
Sent: Wednesday, March 19, 2003 11:03 AM
To: 'v_bill_pikounis at merck.com'
Cc: vfasciani
Subject: RE: [R] X11 connection error in web cgi mode only


in order to use vnc as an X11 server you need of:

- the vnc binary (or vnc source to compile n the server), generally you can
find the binary for the following path: /usr/local, you can find the binary
on the vnc web site  (www.realvnc.com).

- appropriate settings to start the vncserver, a my script for vncserver
start/stop follow:


case "$1" in
        # Start the X server deamon
        export PATH
        export HOME
        export OPENWINHOME
        export DISPLAY
        /usr/openwin/bin/xhost +host1 host2 ......
        # Stop the X server deamon
        export PATH
        /usr/local/vnc/vncserver -kill :1
        echo "Usage: $0 { start | stop }"
        exit 1

If all work fine you should see running a process like this: 

root 29315     1  0   Jan 15 ?       164:32 Xvnc :1 -desktop X -auth
//.Xauthority -geometry 1024x768 -depth 16 -rfbwait 12

Let me know any issues.


-----Original Message-----
From: Adaikalavan Ramasamy [mailto:gisar at nus.edu.sg]
Sent: Monday, March 17, 2003 2:43 PM
To: r-help at stat.math.ethz.ch
Subject: [R] X11 connection error in web cgi mode only

Dear all,

I am trying to create a web interface using Perl-CGI to call R plots and
to display them.
The following codes works perfectly fine when I copy and paste into the
console directly or if I save it into script.file and then R --no-save <
script.file producing the graphs. 

jpeg("graph.jpeg", width=400, height=400)

Now, I put the line system("R --no-save < script.file > log_file") from
inside my cgi and then process it from client side, I get the following
error message:

Error in X11(paste("jpeg::", quality, ":", filename, sep = ""), width,
        unable to start device JPEG
In addition: Warning message: 
unable to open connection to X11 display`' 
Execution halted

Why do I get this error and how can I fix it? Many thanks in advance.

Regards, Adai.

R-help at stat.math.ethz.ch mailing list

More information about the R-help mailing list