Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Apache profiler errors

by fuzzyping (Chaplain)
on Nov 02, 2004 at 03:51 UTC ( [id://404503]=perlquestion: print w/replies, xml ) Need Help??

fuzzyping has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to profile some perl CGI someone else wrote, but I can't seem to get Apache::DProf working. My server runs Apache 2.0.46 with mod_perl 1.99 and Apache::DProf 0.09. I'm getting the following error when trying to start Apache when Apache::DProf is set to load in httpd.conf:
Starting httpd: [Mon Nov 01 22:37:13 2004] [error] Can't locate object + method "server_root_relative" via package "Apache::Server" at /usr/l +ib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache/DProf.pm line + 30.!Compilation failed in require at (eval 2) line 3.! [Mon Nov 01 22:37:13 2004] [error] Can't load Perl module Apache::DPro +f for server localhost:0, exiting...!
Now, if I'm not mistaken, server_root_relative is in Apache::ServerUtil. Looking at the relevant portion of DProf.pm, it appears to handle the differences between Apache1 and Apache2 correctly, so Apache::compat shouldn't be necessary (although I've tried that too):
package Apache::DProf; use strict; use Apache::DB (); use File::Path (); { no strict; $VERSION = '0.04'; } # Need to determine if we are in a mod_perl 1.x or 2.x environment # and load the appropriate modules BEGIN { use constant MP2 => eval { require mod_perl; $mod_perl::VERSIO +N > 1.99 }; die "mod_perl is required to run this module: $@" if $@; if (MP2) { require Apache2; require Apache::RequestRec; require Apache::ServerUtil; } } # Adjust to handle mp1 and mp2 differently my $prof_path; if (MP2) { my $s = Apache->server; $prof_path = $s->server_root_relative( $ENV{APACHE_DPROF_PATH} || "logs/dprof"); } else { $prof_path = Apache->server_root_relative($ENV{APACHE_DPROF_PATH} +|| "logs/dprof"); }
Any ideas why this module is failing for me? I've tried Googling on the server_root_relative error, but this inevitably directs me to Apache::compat suggestions, which I don't think are relevant to this module. Thanks,

-fp

Replies are listed 'Best First'.
Re: Apache profiler errors
by ides (Deacon) on Nov 02, 2004 at 21:23 UTC
    After further research this problem is due to using an older release candidate of mod_perl 2.0. You have to use at least mod_perl 1.99_16 in order for this to work.

    Frank Wiles <frank@wiles.org>
    http://www.wiles.org

Re: Apache profiler errors
by ides (Deacon) on Nov 02, 2004 at 15:45 UTC
    Saw your message about this post on the mod_perl list. I believe this is fixed by using Apache2 in your startup.pl. Let me know if this indeed does fix your problem and I'll get the Apache::DProf documentation updated. UPDATE: That doesn't seem to fix the problem. Try adding Apache::ServerUtil to your startup.pl

    Frank Wiles <frank@wiles.org>
    http://www.wiles.org

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2025-06-23 12:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.