A
andipfaff
Hi there,
I try to switch from IIS 5 on Win2k to Apache 2.2 on Win2k. None of my
pictures where shown on the new Server. Some tests showed me that
whenever I try to check if a file exists with if(-f "pictures/
photo1.jpg") the files where no longer found. My scripts are located
in the cgi-bin directory below the document root of the website.
It seems that a perl script run under IIS always starts with the
websites document root when using the -f or -e or fopen() function in
Perl, independent of the location of the perl script. On the other
hand a Perl script run under Apache is using an absolute root
directory starting where the script itself is located.
So if I try to find a file located in /pictures with a script located
in /cgi-bin I have to use different code:
IIS: if(-f "pictures/photo1.jpg)
Apache: if(-f "../pictures/photo1.jpg)
I want to avoid modifying all scripts for all virtual websites, and I
want to avoid using absolute paths for the -f function. The first one
is just too much work, th latter one would make the code unflexible
and less portable.
Is there a way to change the behaviour of Apache without touching the
scripts?
Thanks in advance
Andi Pfaff
I try to switch from IIS 5 on Win2k to Apache 2.2 on Win2k. None of my
pictures where shown on the new Server. Some tests showed me that
whenever I try to check if a file exists with if(-f "pictures/
photo1.jpg") the files where no longer found. My scripts are located
in the cgi-bin directory below the document root of the website.
It seems that a perl script run under IIS always starts with the
websites document root when using the -f or -e or fopen() function in
Perl, independent of the location of the perl script. On the other
hand a Perl script run under Apache is using an absolute root
directory starting where the script itself is located.
So if I try to find a file located in /pictures with a script located
in /cgi-bin I have to use different code:
IIS: if(-f "pictures/photo1.jpg)
Apache: if(-f "../pictures/photo1.jpg)
I want to avoid modifying all scripts for all virtual websites, and I
want to avoid using absolute paths for the -f function. The first one
is just too much work, th latter one would make the code unflexible
and less portable.
Is there a way to change the behaviour of Apache without touching the
scripts?
Thanks in advance
Andi Pfaff