perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Prime <>
Subject Re: use lib error
Date Fri, 09 Dec 2016 04:47:04 GMT

I don't think Modperl::Registry sets the current working directory of of
the process when it runs your script, so that might be why it's having
problems. You can try RegistryPrefork instead, if you're running under
the prefork MPM.  If not, then your script will need to be updated to
assumed that the current working directory is /

I could of course be wrong, but this is something to try at least.


On 12/08/2016 05:17 PM, mehryar wrote:
> Hi folks,
> A noobie question here:
> I have a plain simple cgi script in a directory configured for
> Modperl::Registry:
> --------------------
> #!/usr/local/bin/perl
> use strict;
> use warnings
> use lib '../lib';
> use MyApp;
> print "Content-type: text/html\n\n";
> print "hello\n";
> ---------------------
> This script runs correctly under mod_cgi (without mod_perl), implying
> that perl is able to locate through use lib '../lib';
> Now under mod_perl with PerlSwitches -I/Users/mehryar/Sites/lib
> the script runs correctly as well - but only if I comment out the
> 'use lib...' line. Implying again that mod_perl was able to locate
> through the -I/Users/mehryar/Sites/lib.
> But what I don't understand is why it fails if the use lib '../lib'; line
> is present in the script?
> I get the following error:
> Can't locate   Permission denied at
> /Users/mehryar/Sites/cgi/test.cgi
> (This is on my Mac mod_perl2.0.10/Apache2.4.23)
> Reading the docs on how @INC is modified is getting me nowhere.
> cheers,
> -Mehryar

View raw message