> Can you please post a working solution, so I'll add it
> to docs.

I added this to my startup.pl just after the
use Apache::compat();


sub Apache::RequestRec::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: $!";
}


> 
> BTW, perhaps we should enable the chdir_file call in
> ModPerl::RegistryCooker, 
> so people won't need to install mod_perl 1 just to have
> Apache::Registry... 
> can you please try with ModPerl::RegistryCooker?

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 "/".

Perhaps I've done this wrong? I did notice a couple of lines in the
RegistryCooker.pm file that were already commented out, like this:

  #XXX: $self->chdir_file("$Apache::Server::CWD/");

I don't know if that's significant?


Colin



__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

Reply via email to