473,287 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Error when python script run as cgi script

Hi, I'm running a python script which if I run from the command line
as root runs fine. But if I run it through the web-browser as a cgi
script gives the following error "Error in X11: unable to start device
PNG".

Now I should say that this python script is calling fucntions in R (a
scripting languange used in statistics) using the python module RPy,
so this I dunno if this is entirely a Python question, because as far
as I can see the error is being thrown by R. But then as I say, when
the script is run by the root user from the command line everything
goes off without a hitch.

So I dunno is there some way to run a CGI script as root, maybe thats
a bad idea because of security? But any ideas would be welcome.

-Thanks.

Oct 21 '07 #1
1 2414
On Oct 21, 7:28 pm, Dennis Lee Bieber <wlfr...@ix.netcom.comwrote:
On Sun, 21 Oct 2007 09:50:54 -0700, sophie_newbie
<paulgeele...@gmail.comdeclaimed the following in comp.lang.python:
Hi, I'm running a python script which if I run from the command line
as root runs fine. But if I run it through the web-browser as a cgi
script gives the following error "Error in X11: unable to start device
PNG".
Now I should say that this python script is calling fucntions in R (a
scripting languange used in statistics) using the python module RPy,
so this I dunno if this is entirely a Python question, because as far
as I can see the error is being thrown by R. But then as I say, when
the script is run by the root user from the command line everything
goes off without a hitch.

Ah, but does it run if you boot into a NON-graphical command shell
mode...

That error message looks suspiciously like something is trying to
open a graphical display window... A web-server likely does not have any
graphical environment.
--
Wulfraed Dennis Lee Bieber KD6MOG
wlfr...@ix.netcom.com wulfr...@bestiaria.com
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: web-a...@bestiaria.com)
HTTP://www.bestiaria.com/
Ya thanks looks like you're actually right. The strange thing is that
the program, when run from a graphical command line, doesn't actually
open any display window. Although the code doesn't run when executed
as a webserver, most likely, as you pointed out, because there is no
graphical environment. I wonder if there any way I can somehow enable
a graphical environment for the webserver, or do I have to re-write
the underlying code?

Oct 22 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Follower | last post by:
Hi, I've run into an issue which seems to have been discussed previously on `python-dev` but only in context of Zope3: "Fun with 2.3 shutdown" -- Tim Peters...
2
by: John F Dutcher | last post by:
Can anyone comment on why the code shown in the Python error is in some way incorrect...or is there a problem with Python on my hoster's site ?? The highlites don't seem to show here...but line...
14
by: kosuke | last post by:
I keep getting the following error/warning message when using the python based program getmail4: /usr/lib/python2.3/optparse.py:668: FutureWarning: %u/%o/%x/%X of negative int will return a...
2
by: Chris | last post by:
Hi, Wonder if anyone can help me? I am trying to run a perl script but I keep getting this error: /usr/lib/python2.4/posixfile.py:59: DeprecationWarning: The posixfile module is obsolete...
3
by: avenpace | last post by:
Hi I have python cgi script, but when I call it I got server internal error. The log in my apache is (13)Permission denied: exec of '/srv/www/cgi-bin/helo.cgi' failed Premature end of...
1
by: Hari Sekhon | last post by:
Hi, I've written a script to run on windows to extract all zips under a given directory path to another directory path as such: python extractzips.py <fetch all zips under this dir> <put all...
5
by: Grant Edwards | last post by:
I'm trying to use the py-gnuplot module on windows, and have been unable to get it to work reliably under Win2K and WinXP. By default, it uses popen(gnuplotcmd,'w'), but in some situations that...
2
by: Joe Salmeri | last post by:
I believe this bug is also related to the other problem I just reported. OS = Windows XP SP2 DB = Microsoft Access XP PROBLEM: When you use + (or &) to concatenation columns together and...
3
by: koutoo | last post by:
I have a code that writes to 2 seperate files. I keep getting a "list index out of range" error. The strange part is that when checking the files that I'm writing too, the script has already...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.