When I have had these issues in the past it is because Apache tends to limit 
things to within "server accessible" locations, which for security is not the 
whole hard disk.  The strategies I have taken to solve these is create explicit 
aliases in the httpd conf file, or sometimes easier, use symlinks to map out of 
the htdocs folder to locations elsewhere.

From: ckatz...@gmail.com [mailto:ckatz...@gmail.com] On Behalf Of Charlie Katz
Sent: Monday, March 26, 2012 2:44 PM
To: modperl@perl.apache.org
Subject: difference between PerlSetEnv and <Perl>$ENV{}=</Perl> ?

Hi,

My web app uses the PGPLOT module to access PGPLOT, which is a scientific 
plotting library commonly used in my field.  It is a Fortran library, with a C 
wrapper around it, which is then wrapped in Perl.  This works fine in my test 
scripts, producing the desired graphics.

The library requires that the environment variable PGPLOT_DIR be set so it can 
find some required files.  Running from the command line, I just set this in 
the shell, and PGPLOT works fine.  Running in Apache, I see different behavior:

When I set this in httpd.conf:
  PerlSetEnv PGPLOT_DIR /my/pgplot/directory
my Perl programs can see the value in $ENV{PGPLOT_DIR}, but the PGPLOT library 
can't, and my code fails.

When I set this in httpd.conf:
  <Perl>
  $ENV{PGPLOT_DIR} = q[/my/pgplot/directory];
  </Perl>
my Perl programs can't see the value in $ENV, but the PGPLOT library can, and 
my code works.


Can someone help me understand what the difference is between these two cases?

Is the situation muddled because the PGPLOT library is a 
Perl-wrapped-C-wrapped-Fortran library?  I'm not sure how the environment 
passing is supposed to work.

Regards,
Charlie

Reply via email to