On Tue, 29 Jul 2003, ColinB wrote: > Well I commented out the following line in > perl/lib/site_perl/5.8.0/sun4-solaris/Apache2/ModPerl/RegistryCooker.pm > like this: > > #*chdir_file = \&NOP; > > and added an identical definition to the above in my startup.pl file > like this: > > sub ModPerl::RegistryCooker::chdir_file { > use File::Basename(); > my $file = @_ == 2 ? $_[1] : $_[0]->filename; > my $dir = File::Basename::dirname($file); > chdir $dir or die "Can't chdir to $dir: $!"; > } > > and then in my httpd.conf I replaced > PerlResponseHandler Apache::Registry > with > PerlResponseHandler ModPerl::Registry > and then re-started the server. > > But the printenv script just displays the working directory as "/".
Try the following, instead of ModPerl::RegistryCooker::chdir_file above: sub chdir_file_normal { use File::Basename(); my $file = @_ == 2 ? $_[1] : $_[0]->{FILENAME}; my $dir = File::Basename::dirname($file); chdir $dir or die "Can't chdir to $dir: $!"; } -- best regards, randy kobes