PATH problem

Matthew Seaman m.seaman at infracaninophile.co.uk
Mon Nov 10 13:53:47 PST 2008


Albert Shih wrote:

> Maybe my question is not very clear....
> 
> The p5 package work in shell, because the PATH is in the shell. 
> 
> But when I use the application throught the web it's not working. But I
> don't known how to tell apache ? mod_perl ? the PATH. 

If you're using mod_perl2, then Apache will default to setting up the
environment perl sees as if perl was running as a separate CGI script.
See: 

http://perl.apache.org/docs/2.0/user/config/config.html#C_SetupEnv_

(defaults to 'On')

You can modify the perl environment from httpd.conf using PerlSetEnv
or PerlPassEnv. See: 

http://perl.apache.org/docs/2.0/user/config/config.html#C_PerlSetEnv_
http://perl.apache.org/docs/2.0/user/config/config.html#C_PerlPassEnv_

Assuming you do mean $PATH -- the executable search path -- that should 
be sufficient to fix your problem.  If you're really after $PERL5INC -- 
the path to search for perl modules -- while you can use PerlSetEnv to 
set that, it's special-cased not to be passed through when running in 
taint-checking mode.  It's generally cleaner to have a startup.pl 
script you require from the Apache conf, and that can have a BEGIN { } 
block where you modify @INC before loading modules.  See

http://perl.apache.org/docs/2.0/user/config/config.html#C_PerlConfigRequire_

or (preferably):

http://perl.apache.org/docs/2.0/user/config/config.html#C_PerlPostConfigRequire_

which does much the same thing as a perl 'require' statement -- the 
difference between the two being that PerlPostConfigRequire happens 
somewhat later in the configuration process.

	Cheers,

	Matthew


-- 
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
                                                  Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20081110/d60198a4/signature.pgp


More information about the freebsd-questions mailing list