in reply to cgi environment using mod_perl
When under a mod_perl environment, the directory that the perl script is started in can differ from the directory in which the script file itself is located. I'm not sure if it is always the case, but my mod_perl starts scripts up from the apache root (So in my case C:/Apache2/www/port80/serve/foo.pl is executed as though it were C:/Apache2/foo.pl). The simplest way to make it back to regular CGI behaviour is to change directory from within perl. So at the top of your script, you just throw in this line:
BEGIN { chdir "/path/to/script/directory" }
My foo.pl script as mentioned above for example, would include this line:
BEGIN { chdir "C:/Apache2/www/port80/serve" }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: cgi environment using mod_perl
by perrin (Chancellor) on Jan 21, 2004 at 17:52 UTC | |
by Coruscate (Sexton) on Jan 21, 2004 at 22:03 UTC | |
by perrin (Chancellor) on Jan 21, 2004 at 22:13 UTC | |
by Coruscate (Sexton) on Jan 21, 2004 at 22:51 UTC | |
by perrin (Chancellor) on Jan 21, 2004 at 23:24 UTC |