On Wed, May 21, 2008 at 4:29 PM, Fred Moyer <[EMAIL PROTECTED]> wrote:
> william wrote:
>>
>> Hello,
>> It took me hours just to notice that my current working directory of
>> mod_perl2 always appear as "/"
>
> See slide 77 and on:
>
> http://gozer.ectoplasm.org/Talks/mod_perl-2.0-from-cgi-fast.pdf
>
> Specifically slide 81 looks like it addresses this issue.
>
> Try adding:
>
> require "/var/www/modperl/directory/test.pl";
>
> to your cgi script.
>
> Hope that helps.
>
>>
>> Alias /modperl/ /var/www/modperl/
>> <Location /modperl/>
>>  SetHandler perl-script
>>      PerlResponseHandler ModPerl::Registry
>>      PerlOptions +ParseHeaders
>>      Options +ExecCGI
>>      Order allow,deny
>>      Allow from all
>> </Location>
>>
>>
>> But either I place my script at /var/www/modperl/test.pl OR
>> /var/www/modperl/directory/test.pl
>> use CGI qw(:standard);
>> print header;
>>
>> use Cwd;
>> print getcwd();
>>
>>
>> These always print out "/". I have some modules living in my working
>> directory how can I have the directory working as like no using the
>> mod_perl2 before ? Thanks
>
>
> --
> Red Hot Penguin Consulting LLC
> mod_perl/PostgreSQL consulting and implementation
> http://www.redhotpenguin.com/
>

Thanks, I also found the same and better solution using ModPerl::RegistryPrefork
http://perl.apache.org/docs/2.0/api/ModPerl/RegistryPrefork.html

I don't know why they don't just recommend using
ModPerl::RegistryPrefork instead of ModPerl::Registry , that could
save a lot of other people's trouble. But there must be a reason that
I don't know.
Thanks.

Reply via email to