Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Dancer app works until I run it with Plack::Handler::Apache2

by kcott (Archbishop)
on Apr 01, 2022 at 04:31 UTC ( [id://11142586]=note: print w/replies, xml ) Need Help??


in reply to Dancer app works until I run it with Plack::Handler::Apache2

G'day LittleJack,

From your post yesterday (Starting out with Dancer and falling at the first hurdle) you're using Dancer2. The link you've provided is for Dancer documentation; the Dancer2 equivalent is https://metacpan.org/dist/Dancer2/view/lib/Dancer2/Manual/Deployment.pod#With-Plack. I had a quick look and can't see any substantial differences; however, it's better to use the right version of the documentation.

"Which perl and which libraries is my Apache (2.4.7) trying to use?"

Either modify your app.psgi, or write a new one, which outputs various version (and perhaps other) information. A very rough, command line example:

$ perl -e ' use List::Util; print "Perl version: $]\n"; print "List::Util version: $List::Util::VERSION\n"; ' Perl version: 5.034000 List::Util version: 1.56

Other suggestions:

  • Check in your Apache logs for some hints.
  • Check which version of mod_perl or mod_perl2 you have installed.
  • Do you have any instances of Apache::* that should be Apache2::*.
  • Specify a minimum Perl version; e.g. 'use 5.020;'.
  • Specify a minimum List::Util version; e.g. 'use List::Util 1.29 qw{...};'.

Note that I'm attempting to guess what your app.psgi and Apache config look like. Something more concrete from you would be helpful.

— Ken

Replies are listed 'Best First'.
Re^2: Dancer app works until I run it with Plack::Handler::Apache2
by LittleJack (Beadle) on Apr 02, 2022 at 02:39 UTC

    The first version of perldoc which mentions 'pairmap' and 'pairgrep' is for Perl v5.20

    Well that might explain it because my default Perl is still on 5.18.

    But when I check my $List::Util::VERSION it's 1.62 so it should be fine.

    The mystery is somewhat solved when I use Apache2::Status, because Apache is loading some modules from /usr/local/lib/perl/5.18.2/ but some others from /usr/lib/perl/5.18/ where there is indeed an old List::Util.

    How do I convince Apache to load a newer one from a different directory?

        Very helpful, thanks. A rogue startup.pl from another app entirely was to blame.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-25 21:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found