473,671 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2428
On Oct 21, 7:28 pm, Dennis Lee Bieber <wlfr...@ix.net com.comwrote:
On Sun, 21 Oct 2007 09:50:54 -0700, sophie_newbie
<paulgeele...@g mail.comdeclaim ed the following in comp.lang.pytho n:
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.netc om.com wulfr...@bestia ria.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
7310
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 <http://mail.python.org/pipermail/python-dev/2003-September/038151.html> The following message is displayed (one or more times) when exiting (in this case via a `KeyboardInterrupt` exception) a multi-threaded
2
6094
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 #80 and line # 38 are the first line offenders. --> --> -->
14
1928
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 signed string in Python 2.4 and up return ("<%s at 0x%x: %r>" I'm using python2.3.5 on a debian sid box. The getmail4 website/FAQ maintains that this is a bug in the optparse
2
1441
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 and will disappear in the future DeprecationWarning)
3
1639
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 script headers: helo.cgi caught SIGTERM, shutting down
1
1757
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 extracted files under this dir> The purpose of this script is to retrieve backup files which are individually zipped under a backup directory tree on a backup server.
5
14309
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 consistently gets an "invalid operand" IOError when write() is called on the pipe. So I switched to subprocess. It works fine when executed "normally" (e.g. "python progname.py"), but when bundled by py2exe, it always does this:
2
5321
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 the columns are of type text and the combined length exceed 255 this causes pyodbc to fail and python to crash.
3
1531
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 iterated through and finished writing, yet the error stated implies that it hasn't? So how can it be, that my script has written to the files, yet the error is stating that it hasn't made it through the script? I'll have 15 files that I have...
0
8473
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8911
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8819
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8597
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8667
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7428
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6222
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4222
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.