You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Stas Bekman <st...@stason.org> on 2002/06/25 17:20:37 UTC
[PATCH lib/Apache/compat.pm] hinting on missing Apache::Module
As you can see at the attached below correspondance, some people try to
use Apache::compat without having mod_perl 1.0 installed, and things
don't work as expected. So at least this patch hints on how to solve the
problem.
Index: lib/Apache/compat.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v
retrieving revision 1.61
diff -u -r1.61 compat.pm
--- lib/Apache/compat.pm 4 Jun 2002 12:40:53 -0000 1.61
+++ lib/Apache/compat.pm 25 Jun 2002 15:17:56 -0000
@@ -91,7 +91,8 @@
}
sub module {
- require Apache::Module;
+ eval { require Apache::Module };
+ die "Please install Apache::Module from CPAN" if $@;
return Apache::Module::loaded($_[1]);
}
-------- Original Message --------
Subject: Re: Apache::DBI with mod_perl 2.0
Date: Tue, 25 Jun 2002 23:02:10 +0800
From: Stas Bekman <st...@stason.org>
To: Zac Morris <za...@zacwolf.com>
Zac Morris wrote:
> Yeah, so I've tried these suggestions:
>
> use Apache2();
> use Apache::compat;
>
> and I'm still getting the errors:
>
> Undefined subroutine &Apache::Module::loaded called at
> /usr/lib/perl5/site_perl/5.6.1/i386-linux/Apache/compat.pm line 95.
> Compilation failed in require at ./db_connect_test.pm line 38.
> BEGIN failed--compilation aborted at ./db_connect_test.pm line 38.
Apache::Module is not a part of the mod_perl 1.0 core, unfortunately you
have to install it to get this thing working. We will see if there is a
better solution for this kludge.
> I think this boils down to something Per said earlier, I've never
installed
> mod_perl1 only mod_perl2 on an apache 2 server...
you cannot install mod_perl 1.0 with apache 2 server. You probably mean
within the same perl libs install, since you can have both versions
reside under the same perl installation.
> As I understand it the "use Apache::compat" just allows your script to
> utilize the mod_perl1 modules correct?
mod_perl 1.0's third party modules, yes.
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: [PATCH lib/Apache/compat.pm] hinting on missing Apache::Module
Posted by Stas Bekman <st...@stason.org>.
Doug MacEachern wrote:
> On Wed, 26 Jun 2002, Stas Bekman wrote:
>
>
>>yo! the whole thread is wrong, sorry about starting it. For some reason
>>I've assumed that Apache::Module(::loaded()) doesn't exist in 2.0, and
>>it does! So please disregard the whole thing.
>>
>>need to rollback and see why Zac Morris had this problem in first place.
>
>
> it looked to me like he was running from the command line. his message
> said:
>
>
>>Undefined subroutine &Apache::Module::loaded called at
>>/usr/lib/perl5/site_perl/5.6.1/i386-linux/Apache/compat.pm line 95.
>>Compilation failed in require at ./db_connect_test.pm line 38.
>>BEGIN failed--compilation aborted at ./db_connect_test.pm line 38.
>
>
> as in 'perl ./db_connect_test.pm' ?
hmm, good catch Doug ;)
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: [PATCH lib/Apache/compat.pm] hinting on missing Apache::Module
Posted by Doug MacEachern <do...@covalent.net>.
On Wed, 26 Jun 2002, Stas Bekman wrote:
> yo! the whole thread is wrong, sorry about starting it. For some reason
> I've assumed that Apache::Module(::loaded()) doesn't exist in 2.0, and
> it does! So please disregard the whole thing.
>
> need to rollback and see why Zac Morris had this problem in first place.
it looked to me like he was running from the command line. his message
said:
> Undefined subroutine &Apache::Module::loaded called at
> /usr/lib/perl5/site_perl/5.6.1/i386-linux/Apache/compat.pm line 95.
> Compilation failed in require at ./db_connect_test.pm line 38.
> BEGIN failed--compilation aborted at ./db_connect_test.pm line 38.
as in 'perl ./db_connect_test.pm' ?
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: [PATCH lib/Apache/compat.pm] hinting on missing Apache::Module
Posted by Stas Bekman <st...@stason.org>.
yo! the whole thread is wrong, sorry about starting it. For some reason
I've assumed that Apache::Module(::loaded()) doesn't exist in 2.0, and
it does! So please disregard the whole thing.
need to rollback and see why Zac Morris had this problem in first place.
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: [PATCH lib/Apache/compat.pm] hinting on missing
Apache::Module
Posted by Per Einar Ellefsen <pe...@skynet.be>.
At 16:23 26.06.2002, Stas Bekman wrote:
>Stas Bekman wrote:
>>As you can see at the attached below correspondance, some people try to
>>use Apache::compat without having mod_perl 1.0 installed, and things
>>don't work as expected. So at least this patch hints on how to solve the
>>problem.
>
>So while this patch is a step forward, it's still not satisfactory,
>because if mod_perl 1.0 is not installed, Apache::Module won't compile.
Question: does Apache::Module even *work* the way you are expecting here?
Because as mod_perl 2.0 and Apache 2.0 are quite different from the 1.0
versions, I would suspect Apache::Module to be quite off the mark here, right?
>Ideas? Should Apache::compat require mod_perl 1.0?
Problem: people will probably want to use Apache::module on many mod_perl
2.0 installations, just to be able to use the old modules, and will just
leave it on as it doesn't do any harm. So now *mod_perl 2.0* ends up
requiring mod_perl 1.0? Bad. Some parts of Apache::compat might require it,
but not *all* of it.
--
Per Einar Ellefsen
per.einar@skynet.be
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: [PATCH lib/Apache/compat.pm] hinting on missing Apache::Module
Posted by Stas Bekman <st...@stason.org>.
Stas Bekman wrote:
> As you can see at the attached below correspondance, some people try to
> use Apache::compat without having mod_perl 1.0 installed, and things
> don't work as expected. So at least this patch hints on how to solve the
> problem.
So while this patch is a step forward, it's still not satisfactory,
because if mod_perl 1.0 is not installed, Apache::Module won't compile.
Ideas? Should Apache::compat require mod_perl 1.0?
> sub module {
> - require Apache::Module;
> + eval { require Apache::Module };
> + die "Please install Apache::Module from CPAN" if $@;
> return Apache::Module::loaded($_[1]);
> }
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: [PATCH lib/Apache/compat.pm] hinting on missing Apache::Module
Posted by Gerald Richter - ecos gmbh <ri...@ecos.de>.
>
> I didn't say that mod_perl 1.0 is required, for Apache::compat to work.
> It's only required for things like Apache::Module, which Apache::compat
> uses, but the former needs mod_perl 1.0 to be installed (or just the
> header files) in order to compile.
>
ok, I see, I didn't looked close enough at your patch, after reviewing it I
saw that it only dies when Apache::Modules is needed.
Thanks for the enlightment
Gerald
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925131
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: [PATCH lib/Apache/compat.pm] hinting on missing Apache::Module
Posted by Stas Bekman <st...@stason.org>.
Gerald Richter - ecos gmbh wrote:
>
>>As you can see at the attached below correspondance, some people try to
>>use Apache::compat without having mod_perl 1.0 installed, and things
>>don't work as expected. So at least this patch hints on how to solve the
>>problem.
>>
>
>
> Mmmh, I have just the problem the other way round. I don't have mod_perl 1
> installed, but I want to use CGI.pm to retrieve parameters. CGI.pm won't
> load without Apache::compat loaded, but the parts I need works fine when
> Apache::compat is loaded, even without mod_perl 1.
I didn't say that mod_perl 1.0 is required, for Apache::compat to work.
It's only required for things like Apache::Module, which Apache::compat
uses, but the former needs mod_perl 1.0 to be installed (or just the
header files) in order to compile.
> P.S. Does libapreq work with Apache 2 ? This would solve my problem
The C code was ported and the API is still in the alpha stage (that's it
was changed). Once the API has been stabilized we will try to get it
into httpd core and then the perl glue turn will come. So don't expect
that in at least a month or so. stay tuned at the apreq-dev list.
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: [PATCH lib/Apache/compat.pm] hinting on missing Apache::Module
Posted by Gerald Richter - ecos gmbh <ri...@ecos.de>.
> As you can see at the attached below correspondance, some people try to
> use Apache::compat without having mod_perl 1.0 installed, and things
> don't work as expected. So at least this patch hints on how to solve the
> problem.
>
Mmmh, I have just the problem the other way round. I don't have mod_perl 1
installed, but I want to use CGI.pm to retrieve parameters. CGI.pm won't
load without Apache::compat loaded, but the parts I need works fine when
Apache::compat is loaded, even without mod_perl 1.
Gerald
P.S. Does libapreq work with Apache 2 ? This would solve my problem
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925131
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org