Hello mod_perl folks:
I'm having some trouble getting the MasonHQ SiteSource code to run. Looks like a mod_perl/CGI issue is the culprit.
This is what happens when I fire up Apache. (svrctl is a glorified apachectl.)
[EMAIL PROTECTED]:/usr/local/anansi$ sudo bin/svrctl start dev
Password:
starting dev
[Wed May 12 09:40:17 2004] [error] Can't call method "register_cleanup"
on an undefined value at /usr/local/share/perl/5.8.3/CGI.pm line 318.\n
Compilation failed in require at /usr/local/anansi/conf/handler-dev.pl line 12.\n
Compilation failed in require at (eval 4) line 1.\n
Syntax error on line 4 of /usr/local/anansi/conf/httpd-dev.conf:
Can't call method "register_cleanup" on an undefined value at
/usr/local/share/perl/5.8.3/CGI.pm line 318.
Compilation failed in require at /usr/local/anansi/conf/handler-dev.pl
line 12.
Compilation failed in require at (eval 4) line 1.
dev could not be started [EMAIL PROTECTED]:/usr/local/anansi$ head -4 conf/httpd-dev.conf | tail -1 PerlScript /usr/local/anansi/conf/handler-dev.pl [EMAIL PROTECTED]:/usr/local/anansi$
Per Jonathan Swartz's advice, I replaced handler-dev.pl with a Hello World handler and tried again:
#!/usr/bin/perl use CGI; use strict;
my $cgi = new CGI ({});
sub handler { my ($r) = @_;
$r->send_http_header; $r->print("Hello world!");
return 200; }
Same error.
The docs at http://snipurl.com/6c0o (perl.apache.org/...) have this error listed. The entry says:
Can't call method "register_cleanup" (CGI.pm)
Can't call method "register_cleanup" on an undefined value at /usr/lib/perl5/5.00503/CGI.pm line 263.
caused by this code snippet in CGI.pm: if ($MOD_PERL) { Apache->request->register_cleanup(\&CGI::_reset_globals); undef $NPH; }
One solution is to add to httpd.conf: PerlPostReadRequestHandler 'sub { Apache->request(shift) }'
But even better, switch to Apache::Cookie: use Apache; use Apache::Cookie;
sub handler { my $r = shift; my $cookies = Apache::Cookie->new($r)->parse; my %bar = $cookies->{foo}->value; }
I have tried both suggestions. Same error.
This is a Debian system.
I first tried to use system packages for mysql, Apache+mod_perl, Perl, etc.
Perl 5.8.3, all pertinent modules updated to the latest-greatest from CPAN:
apache-perl v1.3.29 (mod_perl v.1.29 staticly linked in)
Perl-5.8.3 (all modules updated to the latest-greatest via CPAN.pm)
CGI.pm v3.05
I rebuilt everything from source:
apache 1.3.31 (built using the Flexible method, lots of modules compiled in)
perl-5.8.4 (all modules updated to the latest-greatest via CPAN.pm)
CGI.pm 3.05
mysql 11.16
How do I proceed forward and get this to work?
Much thanks for any help you can provide, Joshua
-- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html