djneely has asked for the wisdom of the Perl Monks concerning the following question:
We pulled all of the code, paths, etc. over and for the most part have the application up and running until we run into one of the scripts that does the above, opens a file with a relative path. Then it fails. If we run the code via the command line, the relative path works. If we modify the path to be the full path it works both via command line and through Apache (navigating to the page in the browser). This makes me think there is some module or configuration option we need to set in Apache to allow for the perl scripts to access or use the open command with relative paths? After reading a few other posts that seem to have the same issue (but never saw a final solution) we added in a couple print statementsopen(HANDLE,"<../relative/path/to/file.txt")
And the script despite being in /srv/site/scripts/script.pl and accessible via example.com/scripts/script.pl prints outprint `pwd`; print `ls -l`;
Thoughts on what we're doing wrong here and why the script does not see its actual path and therefore able to access another file up a directory and into another?/ the contents of / of the server... /etc, /var, /home, etc...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl - open with Apache
by choroba (Cardinal) on Feb 04, 2020 at 17:32 UTC | |
|
Re: Perl - open with Apache
by hippo (Archbishop) on Feb 04, 2020 at 17:37 UTC | |
by djneely (Initiate) on Feb 04, 2020 at 17:57 UTC |