You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Hans de Groot <ha...@interspective.nl> on 2001/11/28 16:50:53 UTC

default/server directory perl uses under win32?

Hi,

I have Embperl working nicely on NT4 together with apache and mysql. (and sessions :-) )

I have one thing I don't understand how to solv.

Under linux I use releative paths (like open F,"<../data/paswordfile"  and I open this from htdocs/index.html) My server root is C:\apache and my  document root is d:\servers\www.mywebsite.nl
The file failed to open and I than I did a test like (print F,">../dummy") and after I search my pc for that file it was in C:\ so this means (I think) that perl on win32 things it should always read file from the serverroot?

Is there a way to change this? it would be very anying I have to change all my paths to absolute paths every time I update my pages on linux and want to do the same in the NT version.

Thank for you help

Hans de Groot



------
Hans de Groot
Interspective Internet Services B.V.
Tel: +31 (0) 30 6001180
Fax +31 (0) 30 6044204
www:   http://www.interspective.nl
email:   hansg@interspective.nl




---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: default/server directory perl uses under win32?

Posted by Gerald Richter <ri...@ecos.de>.
Hi,

> this means (I think) that perl on win32 things it should always read file
from the serverroot?
>

Normaly Embperl changes the current working directory to the directory of
the file. This works on Unix and on Windows (at least for me :-)

I see two possibilities why this might fail:

1. You have set optDisableChdir in EMBPERL_OPTIONS

2. I think there are some combinations of ActiveState Perl/mod_perl/Embperl
that has problems in this area. Which versions of the three components you
are unsing ?

Gerald

-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: default/server directory perl uses under win32?

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Wed, 28 Nov 2001, Hans de Groot wrote:

> Hi,
>
> I have Embperl working nicely on NT4 together with apache and
> mysql. (and sessions :-) )
>
> I have one thing I don't understand how to solv.
>
> Under linux I use releative paths (like open
> F,"<../data/paswordfile"  and I open this from
> htdocs/index.html) My server root is C:\apache and my
> document root is d:\servers\www.mywebsite.nl The file failed
> to open and I than I did a test like (print F,">../dummy")
> and after I search my pc for that file it was in C:\ so this
> means (I think) that perl on win32 things it should always
> read file from the serverroot?

I'm not sure if this is the cause, but there was a change in
Win32 Apache a few versions ago that sets some defaults to use
the path to Apache.exe so that people could double-click on the
Apache.exe icon and it would start OK.

> Is there a way to change this? it would be very anying I have
> to change all my paths to absolute paths every time I update
> my pages on linux and want to do the same in the NT version.

I'm not sure about Embperl, but in a cgi environment sometimes
relative paths like '../' can fail, even on Unix. You could use
the FindBin module to locate the directory of your script, and
then specify the path relative to that, as in
'/path/to/script/..'.

best regards,
randy kobes


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org