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 Idon'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 PerlSetEnvor 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
signature.asc
Description: OpenPGP digital signature