What version of perl ?

Post 1.12 Mason has problems with perl 5.6.0 I believe ( or maybe .1 as
well )

You're quite right about the problem not necessarily being a mason one.
However as a mason user - you're likely to get help there all the same on
things that are border line mason ( the new Request object is created IN
ApacheHanler.pm )

Try this:

Change your httpd.conf to use a mason-handler.
Create a mason-handler.pl in either your @INC or your apache root.
I put mine in the later ( /etc/httpd/ on my system ).
Make sure the ownership / permissions of the mason-handler allow execution
( chmod +x if you must )

httpd.conf
-----------------------------------------------------------------
PerlRequire mason-handler.pl

<Directory /var/virtual/www.mason-site.com>
        <FilesMatch "\.(html|js|css)$">
                SetHandler perl-script
                PerlHandler HTML::Mason
        </FilesMatch>
</Directory>
================================

mason-handler.pl
-----------------------------------------------------------------

package HTML::Mason;
use HTML::Mason;
use HTML::Mason::ApacheHandler();
use strict;

my $ah = new HTML::Mason::ApacheHandler (
        comp_root=>'/var/virtual/www.mason-site.com/'
        data_dir=>'/var/virtual/HTML-Mason/data'
        );

chown ( 99, 99, $ah->interp->files_written );
{
        package HTML::Mason::Commands;
        use HTML::Entities;
        use vars qw($global1 $global2 $global3);
        $_escape = sub { my $text = join '', @_;
HTML::Mason::Escapes::basic_html_escape(\$text); return $text }
}
1;

sub handler
{
        my ($r) = @_;
        return -1 if $r->content_type && $r->content_type =~ m|^image/|i;
        $ah->handle_request($r);
}
==================================

That's akin to what we use.
Obviously change the /var/virtual to whatever you use as your root - and
HTML-Mason is just where I wanted to keep our data for cache and stuff.
The $globals are just examples.

Once you've done this - let me know if you still get the same problem.

Remember to keep copies of all files you change.
I'd advice RCS/CVS ( i use the former ) for things like httpd.conf if you
want to keep it tidy.

Regards

Gareth
-----Original Message-----
From: DeAngelo Lampkin [mailto:dlampkin@;xencor.com]
Sent: 07 November 2002 17:54
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Can't locate object method "new" via package
"Apache::Request" (via Mason)...


Hi Gareth,

I'm using the latest version of Mason, Mason 1.15.  As I posted in my
previous email, I put the following lines into my httpd.conf file per the
instructions on Mason's website:

PerlModule HTML::Mason::ApacheHandler
    <FilesMatch "\.msn$">
        SetHandler perl-script
        PerlHandler HTML::Mason::ApacheHandler
    </FilesMatch>

The reason this wasn't posted on a Mason mailing list is that this didn't
seem like a Mason problem per se and the Mason mailing list page
specifically mentioned the Apache Request object (at least in part the
source of my problem)as being something that is not directly Mason
related( http://lists.sourceforge.net/lists/listinfo/mason-users ).  So I
took the advice of the list moderator and posted on the mod_perl list
instead.

Thanks!

DeAngelo

-----Original Message-----
From: Gareth Kirwan [mailto:gbjk@;thermeoneurope.com]
Sent: Thursday, November 07, 2002 1:44 AM
To: DeAngelo Lampkin; [EMAIL PROTECTED]
Subject: RE: Can't locate object method "new" via package
"Apache::Request" (via Mason)...


You need to set Mason up better - probably.

I'm an avid Mason user, and I've seen this a fair few times.
If you want help, you're most likely to get it on the
[EMAIL PROTECTED] list.
However if you want to tell me the version of mason you're using it might
help.

You could use a mason-handler.pl with Mason 1.12 ( or 1.15) and the new
Lexer / Compiller components.

There should be a require statement in your httpd.conf.
This gives you better control over data structures, variable scopes, and an
opportunity to handle persistent database connections better in the handler.

Check out the information on http://www.masonhq.com

Hope this helps.

Gareth

-----Original Message-----
From: DeAngelo Lampkin [mailto:dlampkin@;xencor.com]
Sent: 06 November 2002 23:25
To: [EMAIL PROTECTED]
Subject: Can't locate object method "new" via package "Apache::Request"
(via Mason)...


Hey guys,

You may remember me from such messages as "I can't get mod_perl to compile
on Irix64 systems!".  Well now I've got a whole new problem that I need your
expertise on.

I'm running Apache 1.3x and mod_perl 1.2x on a Linux system.  However,
whenever I go to a page that should be handled by Mason (a perl templating
system), I get the following error message:
--------------------------------------------------------
"[Wed Nov  6 11:56:20 2002] [error] Can't locate object method "new" via
package "Apache::Request" at
/usr/lib/perl5/site_perl/5.8.0/HTML/Mason/ApacheHandler.pm line 878."
--------------------------------------------------------------------

My guess is that this (at some level)involves a configuration error of some
kind.  I added the following lines to my httpd.conf file per the
instructions on Mason's website:

---------------------------------------------------------------
PerlModule HTML::Mason::ApacheHandler
    <FilesMatch "\.msn$">
        SetHandler perl-script
        PerlHandler HTML::Mason::ApacheHandler
    </FilesMatch>
---------------------------------------------------------------------

So I'm not sure what's going on here.   I looked through Apache/Request.pm
and found no "new" method and I didn't find one inside of Apache.pm either
(from which the Request module inherets).  However, I'm assuming this is all
correct and some magical ultra-Perl-guru AUTOLOAD-like functionality is
going on somewhere.


Does anyone have any ideas about what may be causing this?


Thanks,
DeAngelo




Reply via email to