Gary C. New wrote:
> mod_perl = 1.27
> 
> I am trying to setup a <Perl> section in my httpd.conf file that will
> retrieve the web server's environment variables.  I've tried several
> methods and all lead me back to the same problem.
> 
> I first tried using PerlPassEnv but could never get any environment
> variables from it.  I also understand there is a great deal more
> overhead using this method.
> 
> I then tried using $r->subprocess_env but always received an error
> regarding Can't call method "subprocess_env"on an undefined value.  I
> believe this routine is a part of the Apache module.  I verified that it
> was in the perl lib path and then attempted to "use" it in the <Perl>
> section.
> 
> I finally tried using $r->parsed_uri but, again, continue to receive an
> error regarding Can't call method "parsed_uri" on an undefined value.
> The routine is part of the Apache::URI module, which I verified was in
> the path and then attempted to "use" in the <Perl> section.

all of this makes me think that you're after things like $ENV{REMOTE_USER}
and other CGI environment variables?

in general, <Perl> sections within a httpd.conf are executed when Apache is
started.  that means that there is no request to associate with a client, so
no $ENV{REMOTE_USER} or other things make any sense.  that's also why you
couldn't call $r->subprocess_env or $r->parsed_uri - there is no $r at
config time.

so, if it's these environment variables you're looking for, you'll need to
take a step back and assess what you're really trying to do.

if you're after other things - such as variables from /etc/profile - but
can't access them in <Perl> sections that's a different issue, and something
that I'd need to try and recall, as I thought they should be visible at that
point.

--Geoff


-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

Reply via email to