Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: apache 2.4 mod_perl permission denied on standard modules

by 1nickt (Canon)
on Aug 28, 2015 at 20:03 UTC ( #1140374=note: print w/replies, xml ) Need Help??


in reply to Re^2: apache 2.4 mod_perl permission denied on standard modules
in thread apache 2.4 mod_perl permission denied on standard modules

Is there another copy of the module in a directory (with different file permissions) that is earlier in @INC than the one you read in your test script?

The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^4: apache 2.4 mod_perl permission denied on standard modules
by Crackers2 (Parson) on Aug 28, 2015 at 20:46 UTC

    Nope, no copies of Digest/SHA.pm anywhere else

    If I manually add

    require "/usr/lib/perl5/5.18.2/x86_64-linux-thread-multi/Digest/SHA.pm +";

    in a BEGIN block, the error in the apache log changes to:

    Can't locate Fcntl.pm: Permission denied at /usr/lib/perl5/5.18.2/x +86_64-linux-thread-multi/Digest/SHA.pm line 7.

    If I also add an explicit

    use lib '/usr/lib/perl5/5.18.2/x86_64-linux-thread-multi/'

    It ends up with:

    Can't locate integer.pm: Permission denied at /usr/lib/perl5/5.18.2/ +x86_64-linux-thread-multi/Digest/SHA.pm line 8

    With this BEGIN block:

    BEGIN { foreach (@INC) { use lib $_; } }

    which I think should be pretty much a noop (I also tried with reverse @inc, same result) I end up with:

    Can't locate Carp.pm: Permission denied at /usr/lib/perl5/5.18.2/x86 +_64-linux-thread-multi/lib.pm line 25

    And of course Carp.pm is there

      This really sounds as if there is at least one entry in @INC which is not readable for the user Apache is running as. As soon as Perl encounters such a directory, it will stop searching. So you should make sure that the relevant directories you have in @INC appear before the bad ones where the user does not have read permissions.

        Gah I wish I'd known this:

        As soon as Perl encounters such a directory, it will stop searching/

        Found a directory in INC that was readable but not executable; changed to 755 and we're past the issue.

        Still have to figure out why that directory is in INC in the first place; it's not in there when I check INC from the shell, and I don't see it anywhere in the apache config.

        But things are working now. Thanks to both of you!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1140374]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2022-09-29 11:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (125 votes). Check out past polls.

    Notices?