
randy at theoryx5
Apr 25, 2001, 10:15 PM
Post #4 of 7
(1293 views)
Permalink
|
----- Original Message ----- From: "Doug MacEachern" <dougm [at] covalent> To: "Randy Kobes" <randy [at] theoryx5> Cc: <dev [at] perl> Sent: Monday, April 23, 2001 11:04 PM Subject: Re: win32 and apache_1.3.19 > On Mon, 23 Apr 2001, Randy Kobes wrote: > > > This patch also includes the t/TEST.win32 patch sent > > earlier to account for the fact that apache_1.3.19 on Win32 > > sets the relative server root to the path to the apache binary, > > so that $Apache::Server::CWD in t/docs/startup.pl and t/docs/rl.pl > > points to the path of the apache binary, rather than the mod_perl > > build directory, and subsequently the tests get confused > > since @INC doesn't contain the mod_perl build directory. > > did you see my reply to your original message (included below) ? > thanks as always randy! [ ... ] Hi, No, I didn't get that - we may have been having some local network glitches around that time .... > On Sat, 14 Apr 2001, Randy Kobes wrote: > > > Hi, > > One of the changes in apache_1.3.19 for Win32 is that the > > relative ServerRoot was changed to root to the path > > of the apache binary. This has the effect of setting > > $Apache::Server::CWD in t/docs/startup.pl and t/docs/rl.pl > > to the path of the apache binary, rather than the mod_perl > > build directory, and subsequently the tests can't be run > > since @INC doesn't contain the mod_perl build directory. > > The following patch against mod_perl-1.25, tested on > > apache_1.3.19 and perl-5.6.1, fixes this by simply > > substituting the mod_perl build directory for > > $Apache::Server::CWD in these two files. > > i'd rather not iedit those files. will something like the patch below > solve the problem? thanks randy. > > Index: Makefile.PL > =================================================================== > RCS file: /home/cvs/modperl/Makefile.PL,v > retrieving revision 1.179 > diff -u -r1.179 Makefile.PL > --- Makefile.PL 2001/04/17 21:38:52 1.179 > +++ Makefile.PL 2001/04/17 22:20:02 > @@ -95,6 +95,7 @@ > $Apache::MyConfig::Setup{Apache_Src} ; > > my $PWD = cwd; > +$ENV{APACHE_CWD} = $PWD; > $ENV{PERL5LIB} = "$PWD/lib"; [ ... ] This turned out to be an interesting problem .... Basically $ENV{APACHE_CWD}, set within Makefile.PL, or even in t/TEST.win32, doesn't survive the trip to t/docs/startup.pl. I checked the bug database at ActiveState, and apparently it's a problem with Win32::Process - it does inherit environment variables from the console window from which the script is run, but doesn't see changes in %ENV made within that script (this did work in ActivePerl 5xx). A fix is being worked on .... In the meantime, I tried a couple of workarounds, but these weren't very satisfactory. One could put an environment variable temporarily in the Registry, but this seems overkill. Alternatively, apparently there's a program called WINSET which can set console environment variables in a system() call, but WINSET isn't installed in a stock Win32. Another option is to write a batch file which sets APACHE_CWD and then starts apache, and then execute this batch file with Win32::Process - this works, but again seems like overkill. I'll think about this some more .... best regards, randy --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe [at] perl For additional commands, e-mail: dev-help [at] perl
|