You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Brendon Anderson <ba...@hsminc.com> on 2003/02/21 16:27:48 UTC

mod_perl2 apache::requestrec and imagemagick.pm

Apache 2.0.44
Perl 5.8.0
mod_perl 1.99_08
ImageMagick 5.4.7-5
ImageMagick-perl 5.4.7-5
Apache-ImageMagick 2.0b7

I would like to be able to use the PerlMagick package to automatically convert a .tif image to a .jpg image like you can at the website located at: http://modperl.com:9000/examples/chapter4/Apache::Magick.html 

When I try to do this on my setup by going to http://192.168.100.15/images/example.jpg (where example.jpg is really example.tif), I get the following error in my apache error_log:

[Fri Feb 21 09:19:56 2003] [error] [client 192.168.100.128] Can't locate object method "args" via package "Apache::RequestRec" at /usr/lib/perl5/site_perl/5.8.0/Apache/ImageMagick.pm line 256.

I believe Apache::RequestRec is part of the mod_perl package.

I have the following entries in my httpd.conf:

<snip>
LoadModule perl_module modules/mod_perl.so
PerlModule Apache2
.
.
.
<Location /images>
   PerlFixupHandler Apache::ImageMagick
   PerlSetVar AIMCachDir /var/aimcache
</Location>

</snip>

It seems like it wants to work, but obviously there is a problem.  Can somebody please help me figure this out?

Thanks


Re: mod_perl2 apache::requestrec and imagemagick.pm

Posted by Perrin Harkins <pe...@elem.com>.
Brendon Anderson wrote:
> [Fri Feb 21 09:19:56 2003] [error] [client 192.168.100.128] Can't locate object method "args" via package "Apache::RequestRec" at /usr/lib/perl5/site_perl/5.8.0/Apache/ImageMagick.pm line 256.

Sounds like Apache::ImageMagick has not been ported to mod_perl 2.  You 
can try to run it under compat mode, as explained here:
http://perl.apache.org/docs/2.0/user/compat/compat.html#Code_Porting

If you don't want to mess with that, you should run it on mod_perl 1 
instead.

- Perrin


Re: mod_perl2 apache::requestrec and imagemagick.pm

Posted by Nick Tonkin <ni...@tonkinresolutions.com>.
On Fri, 21 Feb 2003, Brendon Anderson wrote:

> Apache 2.0.44
> Perl 5.8.0
> mod_perl 1.99_08
> ImageMagick 5.4.7-5
> ImageMagick-perl 5.4.7-5
> Apache-ImageMagick 2.0b7
>
> I would like to be able to use the PerlMagick package to automatically convert a .tif image to a .jpg image like you can at the website located at: http://modperl.com:9000/examples/chapter4/Apache::Magick.html
>
> When I try to do this on my setup by going to http://192.168.100.15/images/example.jpg (where example.jpg is really example.tif), I get the following error in my apache error_log:
>
> [Fri Feb 21 09:19:56 2003] [error] [client 192.168.100.128] Can't locate object method "args" via package "Apache::RequestRec" at /usr/lib/perl5/site_perl/5.8.0/Apache/ImageMagick.pm line 256.
>
> I believe Apache::RequestRec is part of the mod_perl package.

You are right about that. The error is a little ambiguous but what it
means I think is that you haven't loaded Apache::RequestRec. try putting
it in your startup.pl, then it will be available to all modules.

Also note that $r->args does not behave as it did in mp1 ... it
simplyreturns a string that you would need to parse yourself (where it
used to return an array if called in array context) ... see
http://perl.apache.org/docs/2.0/user/compat/compat.html#C__r_E_gt_args__in_an_Array_Context
for more information.

- nick

-- 

~~~~~~~~~~~~~~~~~~~~
Nick Tonkin   {|8^)>