You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Gerald Richter <ri...@ecos.de> on 2001/05/28 05:53:59 UTC
Re: mod_perl/Embperl and ActiveState Perl
Hi Randy,
> That fits with what I find, too - I seem to recall that you
> pointed out earlier a problem with environment variables in mod_perl
> in a different context, specifically "remembering" their old
> values, so this seems to be a general mod_perl problem, at least
> on Win32. It may even extend beyond mod_perl - on Win32 processes
> started with Win32::Process don't inherit environment variables
> set within the same script that launched the Win32::Process.
>
...but with my Perl that I have compiled on my own it works. So it must have
something to do with ActiveStates way to compile it.
>
> The current directory problem may be challenging - with apache_1.3.19
> and later, they changed things so launching Apache.exe sets the
> ServerRoot relative path to that of the Apache.exe (this was for
> people who double-click on the Apache.exe icon to start it).
I don't think that has anything to do with this change in the start
directory. Apache::Registry calls
$r->chdir_file;
which should change the current directory to the one of the file, but it
doesn't with ActiveState Perl.
chdir_file in defined in Apache.xs, which calls ap_chdir_file with
r->filename as argument and this function simply looks for a / and calls
chdir.
I guess the problem is that chdir on windows doesn't like a path with / as
path separators. So it seems that it is actualy an Apache bug...
At least putting the following at the to test/html/registry/Execute.htm
(which does the same as $r -> chdir_file should do), fixes the bug:
use Cwd ;
use File::Basename ;
my $fn = $r -> filename ;
chdir(dirname ($fn)) ;
>
> I did fool around some with the environment variable settings
> problem - as you say, it doesn't seem to respect localized settings
> within a <Location> or <Directory> directive ... I'll try some
> more .... But at least these problems are on the mod_perl/perl
> side, and you've worked out the Embperl problems ...
>
Gerald
P.S. I send a copy of this mail to dev@perl.apache.org, maybe somebodyelse
has seen this before...
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: mod_perl/Embperl and ActiveState Perl
Posted by Doug MacEachern <do...@covalent.net>.
On Mon, 28 May 2001, Gerald Richter wrote:
> I don't think that has anything to do with this change in the start
> directory. Apache::Registry calls
>
> $r->chdir_file;
>
> which should change the current directory to the one of the file, but it
> doesn't with ActiveState Perl.
> chdir_file in defined in Apache.xs, which calls ap_chdir_file with
> r->filename as argument and this function simply looks for a / and calls
> chdir.
>
> I guess the problem is that chdir on windows doesn't like a path with / as
> path separators. So it seems that it is actualy an Apache bug...
this note from modperl-2.0/todo/api.txt might be worth considering for
1.x/win32:
$r->chdir_file:
not safe for threaded environments. should at least unshift @INC with
dirname $r->filename. consider overriding open() to resolve relative
filenames.
there is not ap_chdir_file() at all in 2.0.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: mod_perl/Embperl and ActiveState Perl
Posted by Gerald Richter <ri...@ecos.de>.
Hi Randy,
>
> That's true - I should have been more explicit. The environment
> variable problem doesn't show up either for me on a Win32 compiled
> without the flags needed for fork emulation on Win32. I'm going to try to
> see if it's a problem with a linux perl compiled with ActiveState's
> compile-time flags - that would indicate if it's Win32-specific or not.
>
I am not sure if I had exactly the same flags as ActiveState, but a threaded
Perl 5.6.0 or 5.6.1 on Unix doesn't shows this problem
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: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: mod_perl/Embperl and ActiveState Perl
Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Mon, 28 May 2001, Gerald Richter wrote:
> Hi Randy,
>
> > That fits with what I find, too - I seem to recall that you
> > pointed out earlier a problem with environment variables in mod_perl
> > in a different context, specifically "remembering" their old
> > values, so this seems to be a general mod_perl problem, at least
> > on Win32. It may even extend beyond mod_perl - on Win32 processes
> > started with Win32::Process don't inherit environment variables
> > set within the same script that launched the Win32::Process.
> >
>
> ...but with my Perl that I have compiled on my own it works. So it must have
> something to do with ActiveStates way to compile it.
That's true - I should have been more explicit. The environment
variable problem doesn't show up either for me on a Win32 compiled
without the flags needed for fork emulation on Win32. I'm going to try to
see if it's a problem with a linux perl compiled with ActiveState's
compile-time flags - that would indicate if it's Win32-specific or not.
> > The current directory problem may be challenging - with apache_1.3.19
> > and later, they changed things so launching Apache.exe sets the
> > ServerRoot relative path to that of the Apache.exe (this was for
> > people who double-click on the Apache.exe icon to start it).
>
> I don't think that has anything to do with this change in the start
> directory. Apache::Registry calls
>
> $r->chdir_file;
>
> which should change the current directory to the one of the file, but it
> doesn't with ActiveState Perl.
> chdir_file in defined in Apache.xs, which calls ap_chdir_file with
> r->filename as argument and this function simply looks for a / and calls
> chdir.
>
> I guess the problem is that chdir on windows doesn't like a path with / as
> path separators. So it seems that it is actualy an Apache bug...
>
> At least putting the following at the to test/html/registry/Execute.htm
> (which does the same as $r -> chdir_file should do), fixes the bug:
>
> use Cwd ;
> use File::Basename ;
>
> my $fn = $r -> filename ;
> chdir(dirname ($fn)) ;
Thanks for the clarification in pinning that down ... At least, as
you say, there is a workaround ....
best regards,
randy
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org