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("hello.tmpl");
my $script = $q->param("script") || "Initial";
my @loop = qw (home about help players);
my @items;
while (@loop) {
push @items, {action => shift @loop};
}
$t->param(script=> $script,menu => \@items);
print $t->output();
exit;
When I run it through a browser I get the following:
[Wed Jul 14 22:02:01 2004] [error] [client 10.0.0.2] Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/5.8.3/Devel/ptkdb.pm line 1120.
[Wed Jul 14 22:02:07 2004] [error] [client 10.0.0.2] couldn't connect to display "localhost:0.0" at /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi/Tk/MainWindow.pm line 55.
[Wed Jul 14 22:02:07 2004] [error] [client 10.0.0.2] MainWindow->new() at /usr/lib/perl5/5.8.3/Devel/ptkdb.pm line 1147
[Wed Jul 14 22:02:07 2004] [error] [client 10.0.0.2] Can't call method "setup_main_window" on unblessed reference at /usr/lib/perl5/5.8.3/Devel/ptkdb.pm line 4151.
[Wed Jul 14 22:02:07 2004] [error] [client 10.0.0.2] END failed--call queue aborted.
[Wed Jul 14 22:02:07 2004] [error] [client 10.0.0.2] Premature end of script headers: index.cgi
I have the following setup:
Apache 2.0.49
Perl 5.8.3
Tk 804.027
ptkdb 1.1091
Fedora Core 1 with all the patches applied
My reasoning is as follows:
1. ptkdb is installed ok with tk since it works fine from a bash shell under my userid
2. i have added all of the xhosts I can
3. changed httpd user to mine to see if that works
4. set env variable for apache virtual host just in case it was some sort of tainting problem on ENV which came up in googlegroups.
5. got to be some sort of X security thing???? And I don't really understand how this works.
Any ideas out there?
Thanks,
Owain.
>> Stay informed about: ptkdb debugger under apache connection to X issue?