Can't locate object method new via package Apache::Request
shutdown !!! error running tests (please examine t/logs/error_log) make: *** [run_tests] Error 1 /results from make test results from t/logs/error_log [Sun Aug 24 21:21:59 2003] [info] Created shared memory segment #4489230 [Sun Aug 24 21:21:59 2003] [info] allocated semaphore #3244050 [Sun Aug 24 21:22:00 2003] [info] Created shared memory segment #4587534 [Sun Aug 24 21:22:00 2003] [info] allocated semaphore #3309586 [Sun Aug 24 21:22:00 2003] [info] created shared memory segment #4653072 /results from t/logs/error_log I then did a make install, but of course the module was broken. I then set my httpd.conf like: PerlSetVar MasonCompRoot/home/oldcomm PerlSetVar MasonDataDir /usr/local/mason/oldcomm LocationMatch (\.html|\.txt|\.pl)$ SetHandler perl-script PerlHandler HTML::Mason::ApacheHandler /LocationMatch LocationMatch (\.m(html|txt|pl)|dhandler|autohandler)$ SetHandler perl-script PerlHandler Apache::Constants::NOT_FOUND /LocationMatch Apache starts just fine, but when I try to access a page, I get: Can't locate object method new via package Apache::Request (perhaps you forgot to load Apache::Request?) at /usr/lib/perl5/site_perl/5.6.1/i386-linux/Apache/Request.pm line 22. So, I adjust my httpd.conf configuration and try to explicitly load Apache::Request by putting PerlModule Apache::Request above the MasonCompRoot in the httpd.conf config above and Apache does not start and this is in the error_log: Can't load '/usr/lib/perl5/site_perl/5.6.1/i386-linux/auto/Apache/Request/Request.so' for module Apache::Request: libapreq.so: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.6.1/i386-linux/DynaLoader.pm line 206. at /usr/lib/perl5/site_perl/5.6.1/i386-linux/mod_perl.pm line 14 I am desperate for help. Can anyone give me a direction to go in other than Reinstall Perl, Apache, mod_perl? Also, I apologize for cross-posting, but this issue is related to both lists. Thanks for any help! Kevin -- K Old [EMAIL PROTECTED] -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html
RE: Can't locate object method new via package Apache::Request
I ran into the same problem. What I had to do was compile libapreq as a shared library first. That solved things nicely. HTH. Regards, S. G. -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html
Re: [Mason] Can't locate object method new via package Apache::Request
On Sun, 24 Aug 2003, K Old wrote: Hello everyone, I've put HTML::Mason on a few servers now and have had problems with Apache::Request and Apache::Test on two of them. My most recent is having the problem and I'm about to go crazy if I don't figure out why installs keep having problems. Here's my setup: RH 7.2, Apache 1.3.27, mod_perl 1.26, Perl 5.6.1 - all installed from RPM's. I did a install HTML::Mason from the CPAN command line and all the dependencies were downloaded and some didn't compile. The two that didn't are Apache::Test-1.03 and libapreq-1.2. [ .. ] Regarding the failure of the tests in these two packages, what happens if you unpack, build, and test these as a non-root user, only becoming root to install them? There's some subtelties running the tests as root. -- best regards, randy kobes -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html
RE: Can't locate object method new via package Apache::Request
Ok, in the libapreq module I did the configure ./configure --with-apache-includes=/usr/includes/apache make make install Everything compiled just fine. Then did perl Makefile.PL make make test make install All of the tests still failed and the t/logs/error_log still reported: [Sun Aug 24 23:01:32 2003] [info] Created shared memory segment #5275663 [Sun Aug 24 23:01:32 2003] [info] allocated semaphore #3768340 [Sun Aug 24 23:01:33 2003] [info] Created shared memory segment #5373967 [Sun Aug 24 23:01:33 2003] [info] allocated semaphore #3833876 [Sun Aug 24 23:01:33 2003] [info] created shared memory segment #5439505 Any advice how I proceed from here? Thanks Kevin On Sun, 2003-08-24 at 22:49, S.B.S wrote: I ran into the same problem. What I had to do was compile libapreq as a shared library first. That solved things nicely. HTH. Regards, S. G. -- K Old [EMAIL PROTECTED] -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html
Re: [Mason] Can't locate object method new via package Apache::Request
On Mon, 25 Aug 2003, K Old wrote: On Mon, 2003-08-25 at 00:18, Randy Kobes wrote: On Sun, 24 Aug 2003, K Old wrote: [ ... ] I did a install HTML::Mason from the CPAN command line and all the dependencies were downloaded and some didn't compile. The two that didn't are Apache::Test-1.03 and libapreq-1.2. [ .. ] Regarding the failure of the tests in these two packages, what happens if you unpack, build, and test these as a non-root user, only becoming root to install them? There's some subtelties running the tests as root. Randy, Ok, yes, this worked...to a point! I pulled down fresh copies of the modules from CPAN, unpacked, build and tested with another user. All tests were successful with Apache::Test with the normal user, but I had to go to root for the tests for libapreq1.2 as my webserver needed the root user to start FrontPage services. Is it possible to disable FrontPage just to see if the libapreq tests are OK when run as another user? Doing the make test for libapreq-1.2 all test fail and I get this in the t/logs/error_log: [Mon Aug 25 08:49:12 2003] [error] Can't load '/home/admin/libapreq-1.2/blib/arch/auto/Apache/Cookie/Cookie.so' for module Apache::Cookie: libapreq.so.1: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.6.1/i386-linux/DynaLoader.pm line 206. [ ... ] I've tried to install DynaLoader.pm from CPAN, but it says it's up to date. That error message means that libapreq.so, which is required by Apache::Cookie, couldn't be loaded. Do you have a libapreq.so under /home/admin/libapreq-1.2/blib/? And if so, does it have the permissions set so that the user under which the web server is running as can load it? -- best regards, randy -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html
RE: Can't locate object method new via package Apache::Request (via Mason)...SOLVED
It's hard to generalize because in some cases the shared object file may actually not be installed. However, there should probably be something in the documentation that tells the user to make sure that the LD_LIBRARY_PATH variable and/or the /etc/ld.so.conf file include the usual default installation paths for required packages. -DeAngelo -Original Message- From: Perrin Harkins [mailto:perrin;elem.com] Sent: Friday, November 08, 2002 1:10 PM To: DeAngelo Lampkin Cc: mod_perl Mailing List Subject: Re: Can't locate object method new via package Apache::Request (via Mason)...SOLVED DeAngelo Lampkin wrote: And of course the other reason is that if the solution to the problem was so obvious from the error message, somebody would have posted a solution before I figured it out (with help from you guys). There is documentation related to this problem in the troubleshooting section, and if you'd like to generalize it a little so it will be easier for others to find when looking at this type of message, your help would be welcome. The current documentation is here: http://perl.apache.org/docs/1.0/guide/troubleshooting.html#install_driver_Oracle__failed__Can_t_load__DBD_Oracle_Oracle_so__for_module_DBD__Oracle - Perrin
RE: Can't locate object method new via package Apache::Request (via Mason)...SOLVED
Huh? It tells you EXACTLY what is wrong. No, not really. One reason is that it's not immediately clear (to me) which file can't be loaded. Is it Request.so or libapreq.so.1 that can't be loaded? This ambiguity is further blurred when you know both files are installed. And of course the other reason is that if the solution to the problem was so obvious from the error message, somebody would have posted a solution before I figured it out (with help from you guys). Searching the mailing list archives indicates that method name resolution is not exacly a new problem with mod_perl. Just ask this guy = http://lists.fsck.com/pipermail/rt-users/2002-September.txt. It's the exact same problem with the exact same error message, only in different clothing (he's having trouble with the Apache::Cookie object rather than the Apache::Request object). In the interest of full disclosure, other possible solutions include resetting /etc/ld.so.conf or the LD_LIBRARY_PATH variable to include more places to look for shared object files (only recently figured this out). But again, unless you're somewhat experienced or have encountered this class of bug before, this won't necessarily be the obvious place to look at first. Anyway enough of my babbling. Now that the answer is out there, hopefully it'll help out the poor souls who run into this issue in the future. Later, DeAngelo -Original Message- From: Ged Haywood [mailto:ged;www2.jubileegroup.co.uk] Sent: Thursday, November 07, 2002 10:01 PM To: DeAngelo Lampkin Cc: mod_perl Mailing List Subject: RE: Can't locate object method new via package Apache::Request (via Mason)...SOLVED Hi there, On Thu, 7 Nov 2002, DeAngelo Lampkin wrote: A file called libapreq.so.1 was located in /usr/local/lib (should have been in /usr/lib) [snip] I ended up getting this thing: Syntax error on line 362 of /usr/local/apache/conf/httpd.conf: Can't load '/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/Apache/Request/Request.so'\ for module Apache::Request: libapreq.so.1: cannot open shared object file:\ No such file or directory [snip] This isn't the most helpful error message in the world. Huh? It tells you EXACTLY what is wrong. 73, Ged.
RE: Can't locate object method new via package Apache::Request (via Mason)...SOLVED
Cool. Will do. -Original Message- From: Tim Tompkins [mailto:timt;arttoday.com] Sent: Thursday, November 07, 2002 12:27 PM To: DeAngelo Lampkin; [EMAIL PROTECTED] Subject: Re: Can't locate object method new via package Apache::Request (via Mason)...SOLVED As a quick follow-up, the PerlModule Apache::Request line is NOT needed in the httpd.conf file for Mason to work. However, it was a very valuable debugging tool. That wasn't really the purpose, though. The purpose was to pre-load the module in the parent apache process for efficiency. My suggestion did come about because it appeared that Apache::Request wasn't being loaded at all. I'm not exacly sure how that happened as Mason's ApacheRequest attempts to require() Apache::Request a couple of places. But just the same, my suggestion to pre-load Apache::Request, as well as any other lib you normally use, stands. See: http://perl.apache.org/docs/1.0/guide/performance.html#Preloading_Perl_Modul es_at_Server_Startup Regards, Tim Tompkins -- Programmer http://www.clipart.com/ http://www.rebelartist.com/ --
Re: Can't locate object method new via package Apache::Request(via Mason)...SOLVED
DeAngelo Lampkin wrote: And of course the other reason is that if the solution to the problem was so obvious from the error message, somebody would have posted a solution before I figured it out (with help from you guys). There is documentation related to this problem in the troubleshooting section, and if you'd like to generalize it a little so it will be easier for others to find when looking at this type of message, your help would be welcome. The current documentation is here: http://perl.apache.org/docs/1.0/guide/troubleshooting.html#install_driver_Oracle__failed__Can_t_load__DBD_Oracle_Oracle_so__for_module_DBD__Oracle - Perrin
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
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
RE: Can't locate object method new via package Apache::Request (via Mason)...
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
Re: Can't locate object method new via package Apache::Request (via Mason)...
Is Apache::Request installed for perl 5.8.0? Sounds like it's not loaded, anyway. Regards, Tim Tompkins -- Programmer http://www.clipart.com/ http://www.rebelartist.com/ -- - Original Message - From: DeAngelo Lampkin [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, November 07, 2002 10:54 AM 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
Re: Can't locate object method new via package Apache::Request (via Mason)...
You should pre-load Apache::Request anyway, PerlModule Apache::Request PerlModule HTML::Mason::ApacheHandler FilesMatch \.msn$ SetHandler perl-script PerlHandler HTML::Mason::ApacheHandler /FilesMatch Regards, Tim Tompkins -- Programmer http://www.clipart.com/ http://www.rebelartist.com/ -- - Original Message - From: Tim Tompkins [EMAIL PROTECTED] To: DeAngelo Lampkin [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, November 07, 2002 11:08 AM Subject: Re: Can't locate object method new via package Apache::Request (via Mason)... Is Apache::Request installed for perl 5.8.0? Sounds like it's not loaded, anyway. Regards, Tim Tompkins -- Programmer http://www.clipart.com/ http://www.rebelartist.com/ -- - Original Message - From: DeAngelo Lampkin [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, November 07, 2002 10:54 AM 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
RE: Can't locate object method new via package Apache::Request (via Mason)...
Tim - Did you not get the 18:06 email of mine ? It uses a handler instead. So he wouldn't be using this method anyway - if he decided to follow my suggestion. By the way - i'm new to this list - :-) Gareth -Original Message- From: Tim Tompkins [mailto:timt;arttoday.com] Sent: 07 November 2002 18:16 To: DeAngelo Lampkin; [EMAIL PROTECTED] Subject: Re: Can't locate object method new via package Apache::Request (via Mason)... You should pre-load Apache::Request anyway, PerlModule Apache::Request PerlModule HTML::Mason::ApacheHandler FilesMatch \.msn$ SetHandler perl-script PerlHandler HTML::Mason::ApacheHandler /FilesMatch Regards, Tim Tompkins -- Programmer http://www.clipart.com/ http://www.rebelartist.com/ -- - Original Message - From: Tim Tompkins [EMAIL PROTECTED] To: DeAngelo Lampkin [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, November 07, 2002 11:08 AM Subject: Re: Can't locate object method new via package Apache::Request (via Mason)... Is Apache::Request installed for perl 5.8.0? Sounds like it's not loaded, anyway. Regards, Tim Tompkins -- Programmer http://www.clipart.com/ http://www.rebelartist.com/ -- - Original Message - From: DeAngelo Lampkin [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, November 07, 2002 10:54 AM 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
Re: Can't locate object method new via package Apache::Request (via Mason)...
Sure I did. I was just keeping my response to the context of his present configuration according to the sample he sent. Regards, Tim Tompkins -- Programmer http://www.clipart.com/ http://www.rebelartist.com/ -- - Original Message - From: Gareth Kirwan [EMAIL PROTECTED] To: Tim Tompkins [EMAIL PROTECTED]; DeAngelo Lampkin [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, November 07, 2002 11:20 AM Subject: RE: Can't locate object method new via package Apache::Request (via Mason)... Tim - Did you not get the 18:06 email of mine ? It uses a handler instead. So he wouldn't be using this method anyway - if he decided to follow my suggestion. By the way - i'm new to this list - :-) Gareth
RE: Can't locate object method new via package Apache::Request (via Mason)...SOLVED
Thanks to Tim, Gareth, and Phillippe: OK, I'll start with the solution to the problem and then drag on a bit for how I found it. The problem was the location of a shared object file for the Apache Request object. A file called libapreq.so.1 was located in /usr/local/lib (should have been in /usr/lib), which was ok for the test script that Phillippe gave me and the one-liner that Gareth gave me, but was apparently NOT ok for Mason in the context of mod_perl. I didn't figure this out until I tried Tim's suggestion of preloading the Apache::Request module inside of httpd.conf. I ended up getting this thing: Syntax error on line 362 of /usr/local/apache/conf/httpd.conf: Can't load '/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/Apache/Request/Request.so' for module Apache::Request: libapreq.so.1: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.0/i386-linux-thread-multi/DynaLoader.pm line 229. at /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/mod_perl.pm line 14 Compilation failed in require at (eval 4) line 3. This isn't the most helpful error message in the world. However, I knew Request.so and libapreq.so.1 were installed, but I didn't know if they were in places that the server process expected them to be. So did a search for all the shared object files and noticed libapreq.so.1 file was sitting all by itself in /usr/local/lib, while about a billion other shared object files were inside of /usr/lib. I moved libapreq.so.1 to the place where all the other cool shared object files hung out, crossed my fingers, and booya! It worked. Apprently something about the way I configured the installation for libapreq was not very Mason friendly. Anyway, thanks again for the help. DeAngelo -Original Message- From: Tim Tompkins [mailto:timt;arttoday.com] Sent: Thursday, November 07, 2002 10:16 AM To: DeAngelo Lampkin; [EMAIL PROTECTED] Subject: Re: Can't locate object method new via package Apache::Request (via Mason)... You should pre-load Apache::Request anyway, PerlModule Apache::Request PerlModule HTML::Mason::ApacheHandler FilesMatch \.msn$ SetHandler perl-script PerlHandler HTML::Mason::ApacheHandler /FilesMatch Regards, Tim Tompkins -- Programmer http://www.clipart.com/ http://www.rebelartist.com/ -- - Original Message - From: Tim Tompkins [EMAIL PROTECTED] To: DeAngelo Lampkin [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, November 07, 2002 11:08 AM Subject: Re: Can't locate object method new via package Apache::Request (via Mason)... Is Apache::Request installed for perl 5.8.0? Sounds like it's not loaded, anyway. Regards, Tim Tompkins -- Programmer http://www.clipart.com/ http://www.rebelartist.com/ -- - Original Message - From: DeAngelo Lampkin [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, November 07, 2002 10:54 AM 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
RE: Can't locate object method new via package Apache::Request (via Mason)...SOLVED
As a quick follow-up, the PerlModule Apache::Request line is NOT needed in the httpd.conf file for Mason to work. However, it was a very valuable debugging tool. -Original Message- From: DeAngelo Lampkin Sent: Thursday, November 07, 2002 11:21 AM To: Tim Tompkins; [EMAIL PROTECTED] Subject: RE: Can't locate object method new via package Apache::Request (via Mason)...SOLVED Thanks to Tim, Gareth, and Phillippe: OK, I'll start with the solution to the problem and then drag on a bit for how I found it. The problem was the location of a shared object file for the Apache Request object. A file called libapreq.so.1 was located in /usr/local/lib (should have been in /usr/lib), which was ok for the test script that Phillippe gave me and the one-liner that Gareth gave me, but was apparently NOT ok for Mason in the context of mod_perl. I didn't figure this out until I tried Tim's suggestion of preloading the Apache::Request module inside of httpd.conf. I ended up getting this thing: Syntax error on line 362 of /usr/local/apache/conf/httpd.conf: Can't load '/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/Apache/Request/Request.so' for module Apache::Request: libapreq.so.1: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.0/i386-linux-thread-multi/DynaLoader.pm line 229. at /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/mod_perl.pm line 14 Compilation failed in require at (eval 4) line 3. This isn't the most helpful error message in the world. However, I knew Request.so and libapreq.so.1 were installed, but I didn't know if they were in places that the server process expected them to be. So did a search for all the shared object files and noticed libapreq.so.1 file was sitting all by itself in /usr/local/lib, while about a billion other shared object files were inside of /usr/lib. I moved libapreq.so.1 to the place where all the other cool shared object files hung out, crossed my fingers, and booya! It worked. Apprently something about the way I configured the installation for libapreq was not very Mason friendly. Anyway, thanks again for the help. DeAngelo -Original Message- From: Tim Tompkins [mailto:timt;arttoday.com] Sent: Thursday, November 07, 2002 10:16 AM To: DeAngelo Lampkin; [EMAIL PROTECTED] Subject: Re: Can't locate object method new via package Apache::Request (via Mason)... You should pre-load Apache::Request anyway, PerlModule Apache::Request PerlModule HTML::Mason::ApacheHandler FilesMatch \.msn$ SetHandler perl-script PerlHandler HTML::Mason::ApacheHandler /FilesMatch Regards, Tim Tompkins -- Programmer http://www.clipart.com/ http://www.rebelartist.com/ -- - Original Message - From: Tim Tompkins [EMAIL PROTECTED] To: DeAngelo Lampkin [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, November 07, 2002 11:08 AM Subject: Re: Can't locate object method new via package Apache::Request (via Mason)... Is Apache::Request installed for perl 5.8.0? Sounds like it's not loaded, anyway. Regards, Tim Tompkins -- Programmer http://www.clipart.com/ http://www.rebelartist.com/ -- - Original Message - From: DeAngelo Lampkin [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, November 07, 2002 10:54 AM 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
Re: Can't locate object method new via package Apache::Request (via Mason)...SOLVED
As a quick follow-up, the PerlModule Apache::Request line is NOT needed in the httpd.conf file for Mason to work. However, it was a very valuable debugging tool. That wasn't really the purpose, though. The purpose was to pre-load the module in the parent apache process for efficiency. My suggestion did come about because it appeared that Apache::Request wasn't being loaded at all. I'm not exacly sure how that happened as Mason's ApacheRequest attempts to require() Apache::Request a couple of places. But just the same, my suggestion to pre-load Apache::Request, as well as any other lib you normally use, stands. See: http://perl.apache.org/docs/1.0/guide/performance.html#Preloading_Perl_Modul es_at_Server_Startup Regards, Tim Tompkins -- Programmer http://www.clipart.com/ http://www.rebelartist.com/ --
RE: Can't locate object method new via package Apache::Request(via Mason)...SOLVED
Hi there, On Thu, 7 Nov 2002, DeAngelo Lampkin wrote: A file called libapreq.so.1 was located in /usr/local/lib (should have been in /usr/lib) [snip] I ended up getting this thing: Syntax error on line 362 of /usr/local/apache/conf/httpd.conf: Can't load '/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/Apache/Request/Request.so'\ for module Apache::Request: libapreq.so.1: cannot open shared object file:\ No such file or directory [snip] This isn't the most helpful error message in the world. Huh? It tells you EXACTLY what is wrong. 73, Ged.
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
Re: Can't locate object method new via package Apache::Request (via Mason)...
Seems somewhat similar to a bug I've reported 10 months ago. You might want to try to run the minimal testcase enclosed in the forwarded mail. Phil. ---BeginMessage--- I've found that mod_perl can get confused when dealing with method calls during a redirect_internal phase: 1. page /1 uses method calls, and works when accessed as /1 2. an other page /R uses internal_redirect to go to /1, and mod_perl fails with an undefined subroutine error. This has been seen on: apache 1.3.9-14, perl 5.004.05-1.1, and mod_perl 1.25-3 (Debian potato) and on: apache 1.3.22-2.1, perl 5.6.1-6, and mod_perl 1.26-1 (Debian woody/testing) How to reproduce: Use this startup.pl file: == # Common package Common; use Apache::Constants qw(:common); sub handler($$) { my $self = shift; my $req = shift; $req-content_type('text/plain'); $req-send_http_header(); $req-print($self-doit()); return OK; } sub doit { return COMMON; } # Common::Impl1 package Common::Impl1; ISA=qw(Common); sub doit { return IMPL1\n; } # Common::Impl2; package Common::Impl2; ISA=qw(Common); sub doit { return IMPL2\n; } # Redir package Redir; use Apache::Constants qw(:common); sub handler { my $req = shift; $req-internal_redirect(/1); return OK; } 1; == PerlRequire the above, and use the following apache configuration: == Location /0 Order allow,deny Allow from all SetHandler perl-script PerlHandler Common /Location Location /1 Order allow,deny Allow from all SetHandler perl-script PerlHandler Common::Impl1 /Location Location /2 Order allow,deny Allow from all SetHandler perl-script PerlHandler Common::Impl2 /Location Location /R Order allow,deny Allow from all SetHandler perl-script PerlHandler Redir /Location PerlRequire startup.pl == Then, directing a web browser to /0 prints COMMON, to /1 prints IMPL1, to /2 prints IMPL2, as expectected. Similarly, when pointing to /R (which redirects internally to /1), IMPL1 should appear. However, I get a 500 Internal server error and this in the logs: [error] Undefined subroutine Common::Impl1::handler called at startup.pl line 49. I've tried to debug the problem, and the problem lies inside perl_handler_ismethod() in src/modules/perl/mod_perl.c: it returns different values when called from inside the internal_redirect than called without internal_redirect. Inside perl_handler_ismethod(): if(!sub) return 0; sv = newSVpv(sub,0); if(!(cv = sv_2cv(sv, stash, gv, FALSE))) { GV *gvp = gv_fetchmethod(pclass, sub); if (gvp) cv = GvCV(gvp); sv_2cv() returns different values when called from inside an internal_redirect than called without internal_redirect. Unfortunately, I could not grok sv_2cv(). It's not even documented in the perl docs. Phil. ---End Message---
Can't locate object method header_in via package Apache::Compress
Hi, I get the following error sporadically on modperl 1.27 and apache 1.3.26 and Apache::Compress 1.003 either under RH7.x or Solaris 7: Can't locate object method header_in via package Apache::Compress (perhaps you forgot to load Apache::Compress?) at /u1/lib/perl5/site_perl/5.6.1/Apache/Compress.pm line 14. This is the handler from Apache::Compress.pm: use strict; use Compress::Zlib 1.0; use Apache::File; use Apache::Constants qw(:common); use vars qw($VERSION); sub handler { my $r = shift; my $can_gzip = $r-header_in('Accept-Encoding') =~ /gzip/; # line 14 my $filter = lc $r-dir_config('Filter') eq 'on'; #warn can_gzip=$can_gzip, filter=$filter; return DECLINED unless $can_gzip or $filter; ... } I have observed this more often on our solaris platform than on linux. Any ideas? Dirk
Re: Can't locate object method dir_config via package Apache::RegistryFilter
- Original Message - Date: Tue, 18 Dec 2001 11:32:24 +0100 From: Gerald Menzel [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Can't locate object method dir_config via package Apache::RegistryFilter I have a problem with Apache::RegistryFilter. I can't get it to work. If I try to use it I allways get this error message: [error] Can't locate object method dir_config via package Apache::RegistryFilter ´ (perhaps you forgot to load Apache::RegistryFilter?) at C:/Programme/Perl/site/lib/Apache/RegistryFilter.pm line 17. Excerpt of my perl.conf: PerlModule Apache::Filter PerlModule Apache::RegistryFilter Files ~ \.pl$ PerlSetVar Filter on SetHandler perl-script PerlHandler Apache::RegistryFilter Options +ExecCGI /Files Hi, You have to specify the chain of filters in httpd.conf. Here's an example that takes the output of a script test.pl and filters it through Apache::Reverse, which simple reverses the order of the lines test.pl prints out. In httpd.conf: PerlModule Apache::Filter PerlModule Apache::RegistryFilter PerlModule Apache::Reverse Directory /Apache/htdocs/filter SetHandler perl-script PerlSetVar Filter on PerlHandler Apache::RegistryFilter Apache::Reverse Options +ExecCGI /Directory The script test.pl in the /Apache/htdocs/filter directory is ** use strict; print END; LINE 1 LINE 2 LINE 3 END ** while the perl module Apache::Reverse is ** package Apache::Reverse; use strict; use Apache::Constants qw(:common); sub handler { my $r = shift-filter_register; my ($fh, $status) = $r-filter_input(); $r-content_type(text/html); $r-send_http_header; print reverse $fh; warn Status is $status; return OK; } 1; ** Does this work for you? best regards, randy kobes
Re: Can't locate object method dir_config via package Apache::RegistryFilter
- Original Message - From: Randy Kobes [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: mod_Perl [EMAIL PROTECTED] Sent: Saturday, December 22, 2001 5:51 PM Subject: Re: Can't locate object method dir_config via package Apache::RegistryFilter - Original Message - Date: Tue, 18 Dec 2001 11:32:24 +0100 From: Gerald Menzel [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Can't locate object method dir_config via package Apache::RegistryFilter I have a problem with Apache::RegistryFilter. I can't get it to work. If I try to use it I allways get this error message: [error] Can't locate object method dir_config via package Apache::RegistryFilter ´ (perhaps you forgot to load Apache::RegistryFilter?) at C:/Programme/Perl/site/lib/Apache/RegistryFilter.pm line 17. Excerpt of my perl.conf: PerlModule Apache::Filter PerlModule Apache::RegistryFilter Files ~ \.pl$ PerlSetVar Filter on SetHandler perl-script PerlHandler Apache::RegistryFilter Options +ExecCGI /Files Hi, You have to specify the chain of filters in httpd.conf. Here's an example that takes the output of a script test.pl and filters it through Apache::Reverse, which simple reverses the order of the lines test.pl prints out. In httpd.conf: PerlModule Apache::Filter PerlModule Apache::RegistryFilter PerlModule Apache::Reverse Directory /Apache/htdocs/filter SetHandler perl-script PerlSetVar Filter on PerlHandler Apache::RegistryFilter Apache::Reverse Options +ExecCGI /Directory The script test.pl in the /Apache/htdocs/filter directory is ** use strict; print END; LINE 1 LINE 2 LINE 3 END ** while the perl module Apache::Reverse is ** package Apache::Reverse; use strict; use Apache::Constants qw(:common); sub handler { my $r = shift-filter_register; my ($fh, $status) = $r-filter_input(); $r-content_type(text/html); $r-send_http_header; print reverse $fh; warn Status is $status; return OK; } 1; ** Does this work for you? best regards, randy kobes Thanks Randy, I have tested this save configuration but the same error still appears. I can't figure out why. It would be great if you can help me! bb, Gerald Menzel.
Can't locate object method dir_config via package Apache::RegistryFilter
Hi, I have a problem with Apache::RegistryFilter. I can't get it to work. If I try to use it I allways get this error message: [error] Can't locate object method dir_config via package Apache::RegistryFilter ´ (perhaps you forgot to load Apache::RegistryFilter?) at C:/Programme/Perl/site/lib/Apache/RegistryFilter.pm line 17. Excerpt of my perl.conf: PerlModule Apache::Filter PerlModule Apache::RegistryFilter Files ~ \.pl$ PerlSetVar Filter on SetHandler perl-script PerlHandler Apache::RegistryFilter Options +ExecCGI /Files What's wrong? I've searched the net for an explanation of this error but I don't found anything relevant. I am not an expert of all that Apache/Perl stuff, so I hope that someone here can help me. bb, Gerald Menzel.
Re: Can't locate object method dir_config via package Apache::RegistryFilter
Sorry Anand, but this don't help me, because I want to use Apache::Filter for parsing the output of cgi-scripts. bb, Gerald Menzel. This should help you, Files *.cgi SetHandler perl-script PerlHandler Apache::Registry Options +ExecCGI PerlSendHeader On /Files Regards, Anand Quoting Gerald Menzel [EMAIL PROTECTED]: Hi, I have a problem with Apache::RegistryFilter. I can't get it to work. If I try to use it I allways get this error message: [error] Can't locate object method dir_config via package Apache::RegistryFilter ´ (perhaps you forgot to load Apache::RegistryFilter?) at C:/Programme/Perl/site/lib/Apache/RegistryFilter.pm line 17. Excerpt of my perl.conf: PerlModule Apache::Filter PerlModule Apache::RegistryFilter Files ~ \.pl$ PerlSetVar Filter on SetHandler perl-script PerlHandler Apache::RegistryFilter Options +ExecCGI /Files What's wrong? I've searched the net for an explanation of this error but I don't found anything relevant. I am not an expert of all that Apache/Perl stuff, so I hope that someone here can help me. bb, Gerald Menzel. With Regards, Anand Ratnasabapathy, DSM Soft(P)Ltd, No:25,Nungambakkam High Road, Chennai - 600 034.
Can't locate object method cleanup_for_exec via package Apache
Hi list, I'm understood that fork'ing from mod_perl is not very good idea, but we have no choice. Because it is up to user to decide to launch job which syncronize data in the two database sources. And this job may take a long time. I'm has no expirience before in using fork call, so I'm reading chapter '10.4.3 Forking and Executing Subprocesses from mod_perl' of mod_perl Guide careful. I'm understood that I must cleanup soket in child process. In '10.4.3.2 Freeing the Parent Process' written [cp]: 'Apache::SubProcess comes to help and provides a method cleanup_for_exec() which takes care of closing this file descriptor.' p 365. But I'm does not see such sub in the Apache::Subprocess. And my code generates run time error Can't locate object method cleanup_for_exec via package Apache My RH linux with kernel 2.2.14-5.0, Apache/1.3.12 (Unix) mod_perl/1.25 mod_perl Guide: Version 1.30 Sep, 2 2001. Apache::SubProcess v0.02. Am I miss something ? -- Best regards, Mike mailto:[EMAIL PROTECTED]
Re: Can't locate object method cleanup_for_exec via package Apache
You might be able to do what you want without forking, and without tying up your apache process while the database sync takes place. Just write a server process using something like IO::Socket or POE (see http://poe.perl.org). Have the mod_perl handler send a message to the separate server process to start the long-running job. You might even be able to query the server process from mod_perl to check on the status of said job, to report the status to the web browser.I started work on this sort of solution last spring, and it looked feasible, but I got pulled to a different project before I could fully implement it. I'm curious to see what others think of this approach. HTH, Wes Sheldahl Mike P. Mikhailov [EMAIL PROTECTED] on 10/08/2001 10:46:41 AM Please respond to Mike P. Mikhailov [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc:(bcc: Wesley Sheldahl/Lex/Lexmark) Subject: Can't locate object method cleanup_for_exec via package Apache Hi list, I'm understood that fork'ing from mod_perl is not very good idea, but we have no choice. Because it is up to user to decide to launch job which syncronize data in the two database sources. And this job may take a long time. I'm has no expirience before in using fork call, so I'm reading chapter '10.4.3 Forking and Executing Subprocesses from mod_perl' of mod_perl Guide careful. I'm understood that I must cleanup soket in child process. In '10.4.3.2 Freeing the Parent Process' written [cp]: 'Apache::SubProcess comes to help and provides a method cleanup_for_exec() which takes care of closing this file descriptor.' p 365. But I'm does not see such sub in the Apache::Subprocess. And my code generates run time error Can't locate object method cleanup_for_exec via package Apache My RH linux with kernel 2.2.14-5.0, Apache/1.3.12 (Unix) mod_perl/1.25 mod_perl Guide: Version 1.30 Sep, 2 2001. Apache::SubProcess v0.02. Am I miss something ? -- Best regards, Mike mailto:[EMAIL PROTECTED]
Re: Can't locate object method cleanup_for_exec via package Apache
Mike P. Mikhailov wrote: Hi list, I'm understood that fork'ing from mod_perl is not very good idea, but we have no choice. Because it is up to user to decide to launch job which syncronize data in the two database sources. And this job may take a long time. I'm has no expirience before in using fork call, so I'm reading chapter '10.4.3 Forking and Executing Subprocesses from mod_perl' of mod_perl Guide careful. I'm understood that I must cleanup soket in child process. In '10.4.3.2 Freeing the Parent Process' written [cp]: 'Apache::SubProcess comes to help and provides a method cleanup_for_exec() which takes care of closing this file descriptor.' p 365. But I'm does not see such sub in the Apache::Subprocess. And my code generates run time error Can't locate object method cleanup_for_exec via package Apache My RH linux with kernel 2.2.14-5.0, Apache/1.3.12 (Unix) mod_perl/1.25 mod_perl Guide: Version 1.30 Sep, 2 2001. Apache::SubProcess v0.02. Am I miss something ? Nope, Doug hasn't released an updated Apache::Subprocess yet. Search the mailing list archive (see http://perl.apache.org/) for 'cleanup_for_exec' and you will get the patch that I've posted for the current version. Sorry for causing confusion. _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://ticketmaster.com http://apacheweek.com http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
Re: Can't locate object method module via package Apache
[CC'ing mod_perl list] Jason Shaw wrote: Hi, I found the archive below, and am having the same problem. Mine occurs whenever I try to start Apache. I just want to know where I would put that fix that you posted below? Should I edit the DBI.pm file, or somewhere in my configuration script for apache? thanks for your time and any help that can be given, -jason shaw. http://hcst.com On Thu, 21 Jun 2001, Surat Singh Bhati wrote: I am getting the following error in my strartup.pl perl -cx startup.pl Can't locate object method module via package Apache at /usr/local/lib/perl5 /site_perl/5.6.0/Apache/DBI.pm line 202. Compilation failed in require at startup.pl line 11. Line 11 of startup.pl 11 use Apache::DBI(); Line 202 of DBI.pm 202 ) if ($INC{'Apache.pm'} and Apache-module('Apache::Status')); Can you pelase tell me the possible cause of this error. Apache::DBI is up to date as perl CPAN. this is fine. You are not running in mod_perl environment. A possible remedy is to: if ($ENV{MOD_PERL}){ # put all the staff that requires mod_perl in here # e.g. Apache::DBI } This is not a fix, this just makes sure that you don't attempt to run mod_perl modules if you haven't configured mod_perl. This checking is placed into startup.pl. That's the file that you PerlRequire from httpd.conf. Another simpler approach is to put the following at the top of the startup.pl file: die no mod_perl :( unless $ENV{MOD_PERL}; You problem is that you probably haven't configured Apache to run mod_perl or you may even not installed the mod_perl at all. The mod_perl guide features a section with 1001 ways to check that mod_perl is running. See the ttp://perl.apache.org/guide/install.html chapter Hope this clear this issue. _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://eXtropia.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
Can't locate object method module via package Apache
I am getting the following error in my strartup.pl perl -cx startup.pl Can't locate object method module via package Apache at /usr/local/lib/perl5 /site_perl/5.6.0/Apache/DBI.pm line 202. Compilation failed in require at startup.pl line 11. Line 11 of startup.pl 11 use Apache::DBI(); Line 202 of DBI.pm 202 ) if ($INC{'Apache.pm'} and Apache-module('Apache::Status')); Can you pelase tell me the possible cause of this error. Apache::DBI is up to date as perl CPAN. Regards, -Surat Singh
Can't locate object method parse via package Apache::Cookie
Using Mason and mod_perl w/ Apache, all the latest versions, I'm getting a weird error I've reinstalled them all, but I can't figure out this error... the debug/anon/13 file is a mason debug file. test.pl is a quick file I whipped up to test if it occured outside of mason, which it indeed did. Obviously test.pl wouldn't ever work, but I think it illustrates the error. I'm afraid I'm doing something very foolish, hopefully someone can set me straight. Thanks, - Dave --- [dave@powerbook dave]$ perl /home/dave/www/mason/debug/anon/13 Can't locate object method parse via package Apache::Cookie (perhaps you forgot to load Apache::Cookie?) at /apache/conf/handler.pl line 75. [dave@powerbook dave]$ cat test.pl use Apache::Cookie; $lkj = parse Apache::Cookie; [dave@powerbook dave]$ perl test.pl Can't locate object method parse via package Apache::Cookie (perhaps you forgot to load Apache::Cookie?) at test.pl line 3. [dave@powerbook dave]$
RE: Can't locate object method parse via package Apache::Cookie
your syntax is wrong... try my %cookiejar = Apache::Cookie-new($r)-parse; and I assume that you know Apache::Cookie is part of libapreq and not part of the mod_perl distribution... HTH --Geoff -Original Message- From: David Boone To: [EMAIL PROTECTED] Sent: 5/30/01 4:44 PM Subject: Can't locate object method parse via package Apache::Cookie Using Mason and mod_perl w/ Apache, all the latest versions, I'm getting a weird error I've reinstalled them all, but I can't figure out this error... the debug/anon/13 file is a mason debug file. test.pl is a quick file I whipped up to test if it occured outside of mason, which it indeed did. Obviously test.pl wouldn't ever work, but I think it illustrates the error. I'm afraid I'm doing something very foolish, hopefully someone can set me straight. Thanks, - Dave --- [dave@powerbook dave]$ perl /home/dave/www/mason/debug/anon/13 Can't locate object method parse via package Apache::Cookie (perhaps you forgot to load Apache::Cookie?) at /apache/conf/handler.pl line 75. [dave@powerbook dave]$ cat test.pl use Apache::Cookie; $lkj = parse Apache::Cookie; [dave@powerbook dave]$ perl test.pl Can't locate object method parse via package Apache::Cookie (perhaps you forgot to load Apache::Cookie?) at test.pl line 3. [dave@powerbook dave]$
Can't locate object method new via package Cache
Hi, all: I try to test IPC::Cache module. I got the following error message. Any help will be highly appreciated. Can't locate object method "new" via package "Cache" at cache-test.pl line 5. Zeke Wu __ Do You Yahoo!? Yahoo! Messenger - Talk while you surf! It's FREE. http://im.yahoo.com/
Re: Can't locate object method No via package such
On 25 Sep 2000, Alan E. Derhaag wrote: Good try, but /dev/null is not broken on my machine. ok, i have seen this happen at least once in the past, glad it's not a common problem. looking back now at some other mod_ssl fixes for 'make test', i'm reading that mod_ssl has some sort of problem with /dev/null. i don't know the details, but maybe this patch will fix the problem for you. however, we had switched from -e0 to /dev/null in mod_perl-1.17, something todo with suexec/setuid, which i think will still be a problem looking at perl.c: if (PL_euid != PL_uid || PL_egid != PL_gid) Perl_croak(aTHX_ "No -e allowed in setuid scripts"); --- src/modules/perl/mod_perl.c 2000/09/01 05:23:17 1.126 +++ src/modules/perl/mod_perl.c 2000/09/26 17:03:39 @@ -668,7 +668,7 @@ #ifdef WIN32 argv[argc++] = "nul"; #else -argv[argc++] = "/dev/null"; +argv[argc++] = "-e0"; #endif MP_TRACE_g(fprintf(stderr, "perl_parse args: "));
RE: Can't locate object method No via package such
Shoulda thought about your answer first, Doug. :-) I see this type of message ("error at /dev/null") when my mod_perl scripts give warnings -w style instead of $r-warn. For example, HTML::Embperl, or Apache::Registry both do this. The nature of the error message sez to me there is a mishandled error somewhere, like possibly an eval that is turning into a method call: eval { # read file here # file doesn't exist # error is No such file or directory # which is parsed by perl to something like: # such-No (file or directory) }; Which further tends to suggest that a necessary environment variable for SSL is either not defined or pointing to the wrong place?? I would suggest *never* disregarding configtest errors... one poorly indicative error message can be the final gasp of a long string of errors caused by a simple typo or whatever several layers deep. Good luck! L8r, L V -Original Message- From: Alan E. Derhaag [mailto:[EMAIL PROTECTED]] Sent: Monday, September 25, 2000 7:29 PM To: Doug MacEachern Cc: [EMAIL PROTECTED] Subject: Re: Can't locate object method "No" via package "such" Doug MacEachern [EMAIL PROTECTED] writes: On 4 Sep 2000, Alan E. Derhaag wrote: I upgraded to openssl-0.9.5a and recompiled apache w/mod_ssl and mod_perl defining the SSL_BASE to the apache src and now the thing won't start and complains about: Can't locate object method "No" via package "such" at /dev/null line 1. looks to me like /dev/null is broken. if you run: % cat /dev/null Good try, but /dev/null is not broken on my machine. I finally gave up and eliminated the DSO version by compiling two versions of httpd. Both include mod_ssl but the Engine is only turned on with the light server. I did find a slight problem when running `configtest' but I doubt that that could have been the problem. --
Re: Can't locate object method No via package such
[EMAIL PROTECTED] (Alan E. Derhaag) wrote: I upgraded to openssl-0.9.5a and recompiled apache w/mod_ssl and mod_perl defining the SSL_BASE to the apache src and now the thing won't start and complains about: Can't locate object method "No" via package "such" at /dev/null line 1. The compile had no warnings or errors except a `assignment discards `const' from pointer target type' warning. I've grepped the source for all (including openssl) and find nothing that might emit this error. Can I get a recommendation of where to look next? This is pretty funny. Somehow an error message "No such something-or-other" is being interpreted as Perl code. I don't know why it thinks the file is /dev/null, but I'd grep for "No such" in your code and see where that error message might be issued/misinterpreted. ------ Ken Williams Last Bastion of Euclidity [EMAIL PROTECTED]The Math Forum
Can't locate object method can_stack_handlers via package Apache
Hi, the problem i'm having is that i'm trying to use a module with the following code in: if(Apache-can_stack_handlers) { Apache-push_handlers(PerlChildInitHandler = sub { for my $aref (@ChildConnect) { shift @$aref; Apache::Sybase::Simple-connect(@$aref); } }); } it's being run in loaded in startup.pl which causes apache to die on startup without any errors and when i run the startup,pl on the command line i get: Can't locate object method "can_stack_handlers" via package "Apache" at /usr/lib/perl5/site_perl/5.005/Apache/Sybase/Simple.pm line 22. BEGIN failed--compilation aborted at startup.pl line 3. startup.pl consists of: use lib qw(/local/0/site/perl); use Apache::Sybase::Simple; Apache::Sybase::Simple-connect_on_init("user", "pass", "server"); 1; It's running on RedHat 6.2 with the RedHat rpm of Apache 1.3.12 and mod_perl 1.24 which was compiled with apxs just in case it was a weird issue with the RedHat rpm of mod_perl. Aside from the APXS options the only other compile option was EVERYTHING=1 so stacked handlers are compiled in. So, what am i missing? thanks struan -- Struan Donald mailto:[EMAIL PROTECTED] Code Flunky, 365 Plc. http://www.365corp.com/
Can't locate object method No via package such
I upgraded to openssl-0.9.5a and recompiled apache w/mod_ssl and mod_perl defining the SSL_BASE to the apache src and now the thing won't start and complains about: Can't locate object method "No" via package "such" at /dev/null line 1. The compile had no warnings or errors except a `assignment discards `const' from pointer target type' warning. I've grepped the source for all (including openssl) and find nothing that might emit this error. Can I get a recommendation of where to look next? -- Alan E. Derhaag New Era Software Development http://www.wolfenet.com/~aderhaag/ Auburn, WA, USA email: [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: Can't locate object method BINMODE via package Apache
[EMAIL PROTECTED] (Doug MacEachern) wrote: On Tue, 11 Apr 2000, Ken Williams wrote: Change that to binmode(STDOUT) and it should work. Since STDOUT is tied, I think Perl is interpreting that as STDOUT-binmode. that's not the problem, see my reply to Roca. Oops, I should have looked before I leaped. Duh. ------ Ken Williams Last Bastion of Euclidity [EMAIL PROTECTED]The Math Forum
Can't locate object method BINMODE via package Apache
I'm using mod_perl-1.21 and testing GD-1.25. When calling any of the demos examples given by GD-1.25 I have the error "Can't locate object method BINMODE via package Apache". The perl scripts are as follows: #!/usr/local/bin/perl use GD; print "Content-type: image/png\n\n" $im = new GD::Image(100,50); ... binmode STDOUT; # print the image to stdout print $im-png; Is somebody knowing the reason of the error ? -- Ignasi Roca
Re: Can't locate object method BINMODE via package Apache
On Tue, 11 Apr 2000, Roca, Ignasi wrote: I'm using mod_perl-1.21 and testing GD-1.25. When calling any of the demos examples given by GD-1.25 I have the error "Can't locate object method BINMODE via package Apache". The perl scripts are as follows: #!/usr/local/bin/perl use GD; print "Content-type: image/png\n\n" $im = new GD::Image(100,50); ... binmode STDOUT; # print the image to stdout print $im-png; Is somebody knowing the reason of the error ? Yep, STDOUT is tied to the Apache class so that it outputs via the Apache API. There should be no need to binmode it. -- Matt/ Fastnet Software Ltd. High Performance Web Specialists Providing mod_perl, XML, Sybase and Oracle solutions Email for training and consultancy availability. http://sergeant.org http://xml.sergeant.org
Re: Can't locate object method BINMODE via package Apache
[EMAIL PROTECTED] (Roca, Ignasi) wrote: I'm using mod_perl-1.21 and testing GD-1.25. When calling any of the demos examples given by GD-1.25 I have the error "Can't locate object method BINMODE via package Apache". The perl scripts are as follows: #!/usr/local/bin/perl use GD; print "Content-type: image/png\n\n" $im = new GD::Image(100,50); binmode STDOUT; Change that to binmode(STDOUT) and it should work. Since STDOUT is tied, I think Perl is interpreting that as STDOUT-binmode.
Re: Can't locate object method BINMODE via package Apache
On Tue, 11 Apr 2000, Roca, Ignasi wrote: I'm using mod_perl-1.21 and testing GD-1.25. When calling any of the demos examples given by GD-1.25 I have the error "Can't locate object method BINMODE via package Apache". the mod_perl cvs snapshot defines a BINMODE stub (5.6.0 added this tied filehandle method). you don't need that to cure, remove the call to binmode or add this code to a startup file: sub Apache::BINMODE {}
Re: Can't locate object method BINMODE via package Apache
On Tue, 11 Apr 2000, Ken Williams wrote: Change that to binmode(STDOUT) and it should work. Since STDOUT is tied, I think Perl is interpreting that as STDOUT-binmode. that's not the problem, see my reply to Roca.
Can't locate object method OPEN via package Apache
I am trying to get the Apache::Magick module from the O'Reilly book "Writing Apache Modules with Perl and C" to work. The error I am running into is: Can't locate object method "OPEN" via package "Apache" (line 80) The looks real simply: open(STDOUT, "=" . fileno($fh)); Any thoughts on what is going wrong? Sam P.S. The whole Apache::Magick is attached, in case you want to look at it. package Apache::Magick; use strict; use Apache::Constants qw(:common); use Image::Magick (); use Apache::File (); use File::Basename qw(fileparse); use DirHandle (); my %LegalArguments = map { $_ = 1 } qw (adjoin background bordercolor colormap colorspace colors compress density dispose delay dither display font format iterations interlace loop magick mattecolor monochrome page pointsize preview_type quality scene subimage subrange size tile texture treedepth undercolor); my %LegalFilters = map { $_ = 1 } qw(AddNoise Blur Border Charcoal Chop Contrast Crop Colorize Comment CycleColormap Despeckle Draw Edge Emboss Enhance Equalize Flip Flop Frame Gamma Implode Label Layer Magnify Map Minify Modulate Negate Normalize OilPaint Opaque Quantize Raise ReduceNoise Rotate Sample Scale Segment Shade Sharpen Shear Solarize Spread Swirl Texture Transparent Threshold Trim Wave Zoom); sub handler { my $r = shift; # get the name of the requested file my $file = $r-filename; # If the file exists and there are no transformation arguments # just decline the transaction. It will be handled as usual. return DECLINED unless $r-args || $r-path_info || !-r $r-finfo; my $source; my ($base, $directory, $extension) = fileparse($file, '\.\w+'); if (-r $r-finfo) { # file exists, so it becomes the source $source = $file; } else { # file doesn't exist, so we search for it return DECLINED unless -r $directory; $source = find_image($r, $directory, $base); } unless ($source) { $r-log_error("Couldn't find a replacement for $file"); return NOT_FOUND; } $r-send_http_header; return OK if $r-header_only; # Read the image my $q = Image::Magick-new; my $err = $q-Read($source); # Conversion arguments are kept in the query string, and the # image filter operations are kept in the path info my(%arguments) = $r-args; # Run the filters foreach (split '/', $r-path_info) { my $filter = ucfirst $_; next unless $LegalFilters{$filter}; $err ||= $q-$filter(%arguments); } # Remove invalid arguments before the conversion foreach (keys %arguments) { delete $arguments{$_} unless $LegalArguments{$_}; } # Create a temporary file name to use for conversion my($tmpnam, $fh) = Apache::File-tmpfile; # Write out the modified image open(STDOUT, "=" . fileno($fh)); $extension =~ s/^\.//; $err ||= $q-Write('filename' = "\U$extension\L:-", %arguments); if ($err) { unlink $tmpnam; $r-log_error($err); return SERVER_ERROR; } close $fh; # At this point the conversion is all done! # reopen for reading $fh = Apache::File-new($tmpnam); unless ($fh) { $r-log_error("Couldn't open $tmpnam: $!"); return SERVER_ERROR; } # send the file $r-send_fd($fh); # clean up and go unlink $tmpnam; return OK; } sub find_image { my ($r, $directory, $base) = @_; my $dh = DirHandle-new($directory) or return; my $source; for my $entry ($dh-read) { my $candidate = fileparse($entry, '\.\w+'); if ($base eq $candidate) { # determine whether this is an image file $source = join '', $directory, $entry; my $subr = $r-lookup_file($source); last if $subr-content_type =~ m:^image/:; $source = ""; } } $dh-close; return $source; } 1; __END__
Re: Can't locate object method OPEN via package Apache
darren chamberlain wrote: Try using CORE::open to be sure that the default open is being called. tried it, I am getting the same error, any more ideas? Sam
Re: Can't locate object method OPEN via package Apache
On Thu, 30 Mar 2000, Sam Carleton wrote: I am trying to get the Apache::Magick module from the O'Reilly book "Writing Apache Modules with Perl and C" to work. The error I am running into is: Can't locate object method "OPEN" via package "Apache" (line 80) The looks real simply: open(STDOUT, "=" . fileno($fh)); try adding: untie *STDOUT; before the open(...)