You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Gerald Richter <ri...@ecos.de> on 2001/07/09 19:44:19 UTC
Re: PerlInitHandler and PerlSetEnv
I recently came across the same problem and track it down. It is a bug in
mod_perl, because the environment is setup when the first handler is called.
If this handler is called before Apache decides which file to use (e.g.
PerlInitHandler), mod_perl can't know about the environment variables inside
the Location/Directory block. When the content handler is called, mod_perl
notice that the environment is already setup and doesn't do it again. So the
variables from the Location/Directory blocks are missing.
I didn't had the time to create a fix/patch, but maybe somebodyelse is able
to do it (or if the bug hits me often enought I will do it ;-)
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
-------------------------------------------------------------
----- Original Message -----
From: "Michael Barry" <mb...@cos.com>
To: <mo...@apache.org>
Sent: Monday, July 09, 2001 5:09 PM
Subject: PerlInitHandler and PerlSetEnv
> All,
> I've noticed some odd behavior (or maybe just
> errant thinking on my part) concerning PerlInitHandler
> and PerlSetEnv. While walking through the demo of
> HTML::EmbperlObject, things were just not working as
> advertised. This configuration:
>
> <Location /foo>
> PerlSetEnv EMBPERL_OBJECT_BASE base.htm
> PerlSetEnv EMBPERL_FILESMATCH "\.htm.?|\.epl$"
> SetHandler perl-script
> PerlHandler HTML::EmbperlObject
> Options ExecCGI
> </Location>
>
> caused problems (error log had messages about being unable to
> find EMBPERL_OBJECT_BASE)
>
> This configuration works fine:
>
> PerlSetEnv EMBPERL_OBJECT_BASE base.htm
> PerlSetEnv EMBPERL_FILESMATCH "\.htm.?|\.epl$"
>
> <Location /foo>
> SetHandler perl-script
> PerlHandler HTML::EmbperlObject
> Options ExecCGI
> </Location>
>
> I somewhat traced the problem down to a PerlInitHandler:
> PerlInitHandler Apache::StatINC
>
> If that is set (or any other PerlInitHandler is set), PerlSetEnv's
> inside Location directives (or Directory directives) do not work.
> If there are no PerlInitHandlers, the PerlSetEnv's inside Location
> directives do work. It's not an embperl thing - I have a simple
> script that just spits out ENV that will demonstrate the issue.
> Is this normal expected behavior? The docs lead me to believe not
> but ...
>
> I've tried this on two configurations and both produce the same
> results:
>
> Configuration one: Digital OSF1 V4.0
> Apache/1.3.20
> perl 5.6.1
> mod_perl 1.21
>
> Configuration two: PowerPC DebianGnu Linux
> Apache/1.3.9
> perl 5.5.3
> mod_perl 1.21.03
>
> Any pointers to further info would be greatly appreciated, -MikeB.
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org