f



couldn't connect to display ":0"

--0-2076467981-1086639284=:72215
Content-Type: text/plain; charset=us-ascii

help
when I run this program:
#!/usr/bin/perl -w
use strict;
use CGI::Carp qw(fatalsToBrowser);
use lib  '/home/bthcraft/cgi-bin/lib/lib/perl5/site_perl/5.8.0/i386-linux';
use Tk;
my $main = new MainWindow; ###barfs here###
$main->Label(-text => 'Hello, world!')->pack;
$main->Button(-text => 'Quit', -command => sub{exit} )->pack;
MainLoop;

I recieve the following error
Mon Jun 7 13:11:43 2004] test.cgi: couldn't connect to display ":0" at /home/bthcraft/cgi-bin/lib/lib/perl5/site_perl/5.8.0/i386-linux/Tk/MainWindow.pm line 55. [Mon Jun 7 13:11:43 2004] test.cgi: MainWindow->new() at /home/bthcraft/cgi-bin/test.cgi line 6 

		
---------------------------------
Do you Yahoo!?
Friends.  Fun. Try the all-new Yahoo! Messenger
--0-2076467981-1086639284=:72215
Content-Type: text/html; charset=us-ascii

<DIV>help</DIV>
<DIV>when I run this program:</DIV>
<DIV>#!/usr/bin/perl -w<BR>use strict;<BR>use CGI::Carp qw(fatalsToBrowser);<BR>use lib&nbsp; '/home/bthcraft/cgi-bin/lib/lib/perl5/site_perl/5.8.0/i386-linux';<BR>use Tk;<BR>my $main = new MainWindow; ###barfs here###<BR>$main-&gt;Label(-text =&gt; 'Hello, world!')-&gt;pack;<BR>$main-&gt;Button(-text =&gt; 'Quit', -command =&gt; sub{exit} )-&gt;pack;<BR>MainLoop;<BR></DIV>
<DIV>I recieve the following error</DIV>
<DIV>Mon Jun 7 13:11:43 2004] test.cgi: couldn't connect to display ":0" at /home/bthcraft/cgi-bin/lib/lib/perl5/site_perl/5.8.0/i386-linux/Tk/MainWindow.pm line 55. [Mon Jun 7 13:11:43 2004] test.cgi: MainWindow-&gt;new() at /home/bthcraft/cgi-bin/test.cgi line 6 </DIV><p>
		<hr size=1><font face=arial size=-1>Do you Yahoo!?<br>Friends.  Fun. <a href="http://messenger.yahoo.com/">Try the all-new Yahoo! Messenger</a>
--0-2076467981-1086639284=:72215--
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majordomo@lists.stanford.edu
0
John
6/7/2004 8:14:44 PM
comp.lang.perl.tk 4721 articles. 0 followers. pharrendorf (19) is leader. Post Follow

1 Replies
1486 Views

Similar Articles

[PageSpeed] 14

John Larson wrote:

> I recieve the following error
> Mon Jun 7 13:11:43 2004] test.cgi: couldn't connect to display ":0" at /home/bthcraft/cgi-bin/lib/lib/perl5/site_perl/5.8.0/i386-linux/Tk/MainWindow.pm line 55. [Mon Jun 7 13:11:43 2004] test.cgi: MainWindow->new() at /home/bthcraft/cgi-bin/test.cgi line 6 

For the most part, only processes that are decendents of your login process
will have the right environment and authorization to open up a window on
your display.

Processes that are created via an HTTP server do not qualify.

Use the Tk modules only for scripts that you run from the command line,
not from cron or apache.
	-Joe
0
Joe
6/8/2004 5:09:34 AM
Reply:

Similar Artilces:

ptkdb running from Apache couldn't connect to display "localhost:0.0"
I am having a problem running ptkdb when invoked by a local httpd server. The script below works ok and will fire up ptkdb ok from a bash shell: #!/usr/bin/perl -w -d:ptkdb #!/usr/bin/perl -wT $|++; # for debugger when httpd invokes CGI #sub BEGIN {$ENV{DISPLAY} = "localhost:0.0"; }; use strict; print "Content-type: text/html\n\n"; use CGI; use FindBin; my $scriptdir = "$FindBin::Bin"; my $tmpldir = "$scriptdir/../templates/"; use lib "/home/owain/www/v2/perl-lib"; my $q = new CGI; my $t = new_template("hell...

RE: couldn't connect to display ":0"
This is a multi-part message in MIME format. ------_=_NextPart_001_01C44CD4.90830B30 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I think that is not a problem with your script, but with the environment = variable DISPLAY that may be set incorrectly. Or if you are running that script from a session window that doesn't let = graphics (spawning windows) though, that is another possibility. =20 Are you running your script from your local host or telnet'ed / rsh'ed ? =20 Iggs -----Original Message----- From: J...

RE: couldn't connect to display ":0" #2
I think the problem is that John is confusing two technologies. Tk is used to interact with a GUI locally (yes, it can display remotely using X-windows if the DISPLAY variable is set to another machine). Contrast this to CGI which is used in a web server environment where there is no display; rather the output is sent back to the requester's browser. So unless you are testing pure locally (i.e. not running under the web server but rather from a command line), this *should* fail. That is why I would say that mixing Tk and CGI is likely a conceptual error on John's part. ...

error: "couldn't execute "date": no such file or directory" in Tk
hi, i am using the following code in a tcl script with the TK framework, and i get the above error on executing the file main file.. main file --------------- #!c:/tcl/bin/tclsh label .l -text "click to execute" button .b -text "Execute" -command "exec_script" proc exec_script {} { set inp 1 source sss.tcl puts $inp } pack .l .b sss.tcl ----------------------------- #!c:/tcl/bin/tclsh set inp 0 puts $inp set d [exec date] The error i get is "couldn't execute "date": no such file or directory" I am using Tk with Tcl and ...

lynx 'browser' can't do "<?xml version="1.0" encoding="utf-8"?>"
lynx is lighteningly fast to fetch a set of pages [via a script] via dump > fileID. But [my current version] doesn't render the 'style' of: "<?xml version="1.0" encoding="utf-8"?>" What is this new "xml" crap ? Will it likely take over the older *.html ? Thanks for any info, == Chris Glur. news@absamail.co.za wrote in news:1172596265.663611@vasbyt.isdsl.net: > lynx is lighteningly fast to fetch a set of pages [via a script] via > dump > fileID. > > But [my current version] doesn't ...

Tkinter problem: TclError> couldn't connect to display ":0
Hi, I use live Debian on VM and trying to compile this code. import Tkinter root = Tkinter.Tk() root.title("Fenster 1") root.geometry("100x100") root.mainloop() The shell gives out that kind of message: File "test.py", line 5, in <module> root = Tkinter.Tk() File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1712, in __init__ self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) _tkinter.TclError: couldn't connect to display ":0" thanks for helping o...

Terminal wedged: "Can't open display: :0.0"
My X11 just crashed unexpectedly (a very rare occurrence, until recently), and after restarting it, I'm no longer able to start X11 programs from Terminal. I killed and re-started both Terminal and X11, for good measure, but still I get the same error in Terminal; e.g.: % echo $DISPLAY :0.0 % xlogo Error: Can't open display: :0.0 Strangely, if I start xlogo directly from X11's Applications->xlogo menu, the xlogo window pops up fine. So clearly the problem is not with X11; it's running fine. I figure that the DISPLAY variable in my Terminal shell is se...

Can't "mk CONF=9pcdisk" --> gives error "rc: #d/0: token '=': syntax error"
I'm in /sys/src/9/pc and I type `mk CONF=9pcdisk` and rc gives me the error "rc: #d/0: token '=': syntax error". Why is this? Just doing mk works fine (I think). Thanks! Plan9 looks very cool... just finished reading through intro (all of it). you're using backquotes, why? that would be `{mk CONF=3D9pcdisk} in rc's syntax. now to compile that kernel the syntax is: % mk 'CONF=3Dpcdisk' now are you sure you want a pcdisk?=20 On Jul 19, 2012, at 6:07 AM, kalaracey@gmail.com wrote: > I'm in /sys/src/9/pc and I type >=20 ...

Python version of perl's "if (-T ..)" and "if (-B ...)"?
Perl has the following constructs to check whether a file is considered to contain "text" or "binary" data: if (-T $filename) { print "file contains 'text' characters\n"; } if (-B $filename) { print "file contains 'binary' characters\n"; } Is there already a Python analog to these? I'm happy to write them on my own if no such constructs currently exist, but before I start, I'd like to make sure that I'm not "re-inventing the wheel". By the way, here's what the perl docs say about these constructs. I'm look...

Fedora 2 "couldn't add command channel 127.0.0.1#953: not found" [solution]
On a laptop, not connected to any network, nor to Internet. Installed Fedora Core 2 from CD's with book "Red Hat Fedora Linux 2 Bible". Selected various web services and Gnome stuff. Booted. As root, started service "named". Result was a "chrooted" ("jailed") service, in "/var/named/chroot". - - - - - What works: 1. Created a file "/var/www/html/index.html", asked browser to show "http://localhost": that page displays. What doesn't work: 1. "host localhost" - times out, can't find a...

"XFree86-DRI" missing on display ":0.0"
Hi, I running on: OS: Redhat 9 System: Dell C400 Video card: Intel 830 Driver: i810 I got this error when running a game (armyops). ====================================================== Xlib: extension "XFree86-DRI" missing on display ":0.0". Couldn't set video mode: Couldn't find matching GLX visual History: Exiting due to error ====================================================== How do I enable the hardware 3D acceleration for this video card? Help!!!! Thanks, PL On Thu, 23 Oct 2003 12:31:01 -0...

ooRexx 4.0.0 using date("F or T") and time("F or T")
Is it right that date("T") and time("T") return the same value? And that date("F") and time("F") return the same value? I think I'd have expected the date() functions to return a value for time 00:00:00 on today's date, and the time() calls to be for the current time on today's date. As it is, the result of date("F") and date("T") are now different at various times in a particular day, which is not the case for - say - date("B"). -- Jeremy C B Nicoll - my opinions are my own. Email sent t...

Couldn't find compiler "MW perl"
Dear All, I am new to Codewarrior, now i am working in existing code. case 1: when i was trying to compile the project, it gives an error "Couldn't find compiler "MW perl". " but i produce the .exe and its working fine. case 2: when i was trying to debug the code, the same error message will appears "Couldn't find compiler "MW perl". " and I was NOT able to debug the code. Could you help me to resolve this issue. Thanks in advance. Cheers, Suresh ...

Couldn't find compiler "MW perl"
Dear All, I am new to Codewarrior, now i am working in existing code. case 1: when i was trying to compile the project, it gives an error "Couldn't find compiler "MW perl". " but i produce the .exe and its working fine. case 2: when i was trying to debug the code, the same error message will appears "Couldn't find compiler "MW perl". " and I was NOT able to debug the code. Could you help me to resolve this issue. Thanks in advance. Cheers, Suresh ...

Web resources about - couldn't connect to display ":0" - comp.lang.perl.tk

Resources last updated: 2/7/2016 3:28:44 AM