You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Woff3 <wo...@hotmail.com> on 2007/12/01 14:56:31 UTC

headers_out

Hi.

I had Apache 2.0 and mod_perl.

Now I upgraded to Apache 2.2.6 and mod_perl2.

I have html-pages where I use mason code.

[code]
$r->header_out("Refresh" => "5; url=$url");
This code worked fine in my previous system.
Now when run my application, I get this error:
Can't locate object method "header_out" via package"Apache::RequestRec"
[/code]

This is strange error, because in my httpd.conf file
I haven't load module Apache::RequestRec

I have load just these modules:
[code]
PerlModule Apache2::AuthCookieDBI
PerlModule Apache2::DBI
PerlModule HTML::Mason::ApacheHandler
PerlModule Apache2::Request
PerlModule Config2::IniFiles
[/code]

Does someone information, how I could fix this problem?
-- 
View this message in context: http://www.nabble.com/headers_out-tf4928260.html#a14105449
Sent from the mod_perl - General mailing list archive at Nabble.com.


Re: headers_out

Posted by Woff3 <wo...@hotmail.com>.
Thanks you very much.

I added that module and it worked !



Roberto C. Sanchez-6 wrote:
> 
> On Sat, Dec 01, 2007 at 05:56:31AM -0800, Woff3 wrote:
>> 
>> Hi.
>> 
>> I had Apache 2.0 and mod_perl.
>> 
>> Now I upgraded to Apache 2.2.6 and mod_perl2.
>> 
>> I have html-pages where I use mason code.
>> 
>> [code]
>> $r->header_out("Refresh" => "5; url=$url");
>> This code worked fine in my previous system.
>> Now when run my application, I get this error:
>> Can't locate object method "header_out" via package"Apache::RequestRec"
>> [/code]
>> 
>> This is strange error, because in my httpd.conf file
>> I haven't load module Apache::RequestRec
>> 
>> I have load just these modules:
>> [code]
>> PerlModule Apache2::AuthCookieDBI
>> PerlModule Apache2::DBI
>> PerlModule HTML::Mason::ApacheHandler
>> PerlModule Apache2::Request
>> PerlModule Config2::IniFiles
>> [/code]
>> 
>> Does someone information, how I could fix this problem?
> 
> Have you tried adding "PerlModule Apache2::compat" in your httpd.conf?
> 
> Regards,
> 
> -Roberto
> -- 
> Roberto C. Sánchez
> http://people.connexer.com/~roberto
> http://www.connexer.com
> 
>  
> 

-- 
View this message in context: http://www.nabble.com/headers_out-tf4928260.html#a14133279
Sent from the mod_perl - General mailing list archive at Nabble.com.


Re: headers_out

Posted by "Roberto C. Sánchez" <ro...@connexer.com>.
On Sat, Dec 01, 2007 at 05:56:31AM -0800, Woff3 wrote:
> 
> Hi.
> 
> I had Apache 2.0 and mod_perl.
> 
> Now I upgraded to Apache 2.2.6 and mod_perl2.
> 
> I have html-pages where I use mason code.
> 
> [code]
> $r->header_out("Refresh" => "5; url=$url");
> This code worked fine in my previous system.
> Now when run my application, I get this error:
> Can't locate object method "header_out" via package"Apache::RequestRec"
> [/code]
> 
> This is strange error, because in my httpd.conf file
> I haven't load module Apache::RequestRec
> 
> I have load just these modules:
> [code]
> PerlModule Apache2::AuthCookieDBI
> PerlModule Apache2::DBI
> PerlModule HTML::Mason::ApacheHandler
> PerlModule Apache2::Request
> PerlModule Config2::IniFiles
> [/code]
> 
> Does someone information, how I could fix this problem?

Have you tried adding "PerlModule Apache2::compat" in your httpd.conf?

Regards,

-Roberto
-- 
Roberto C. Sánchez
http://people.connexer.com/~roberto
http://www.connexer.com

Re: headers_out

Posted by "Philippe M. Chiasson" <go...@ectoplasm.org>.
Woff3 wrote:
> Hi.
> 
> I had Apache 2.0 and mod_perl.

You possibly meant Apache 1.3.xx and mod_perl-1.xx ?

> Now I upgraded to Apache 2.2.6 and mod_perl2.
> 
> I have html-pages where I use mason code.
> 
> [code]
> $r->header_out("Refresh" => "5; url=$url");
> This code worked fine in my previous system.
> Now when run my application, I get this error:
> Can't locate object method "header_out" via package"Apache::RequestRec"
> [/code]

Have you tried preloading Apache2::RequestRec ?

PerlModule Apache2::RequestRec

(http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_headers_out_)

And to improve the odds of folks being able to assist, try
and copy error messages verbatim, instead of paraphrasing them.

When migrating from mod_perl-1.x to 2.x you'll run into various little
annoyances like the one you are reporting. The whole process if fairly
well documented, and your exact issue is discussed, for instance, here:

http://perl.apache.org/docs/2.0/user/porting/compat.html#C__r_E_gt_header_out_



> This is strange error, because in my httpd.conf file
> I haven't load module Apache::RequestRec
> 
> I have load just these modules:
> [code]
> PerlModule Apache2::AuthCookieDBI
> PerlModule Apache2::DBI
> PerlModule HTML::Mason::ApacheHandler
> PerlModule Apache2::Request
> PerlModule Config2::IniFiles
> [/code]
> 
> Does someone information, how I could fix this problem?

-- 
Philippe M. Chiasson     GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/       m/gozer\@(apache|cpan|ectoplasm)\.org/


Re: headers_out

Posted by Woff3 <wo...@hotmail.com>.
Yes, Apache2::compat did the job.



Adam Prime wrote:
> 
> Roberto C. Sánchez wrote:
>>
>> Have you tried adding "PerlModule Apache2::compat" in your httpd.conf?
>>
> 
> Or you can use $r->headers_out.  $r->header_out is no longer supported.
> see:
> 
> http://perl.apache.org/docs/2.0/user/porting/compat.html#C__r_E_gt_err_header_out_
> 
> Adam
> 
> 
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/headers_out-tf4928260.html#a14133281
Sent from the mod_perl - General mailing list archive at Nabble.com.