On Tue, Sep 11, 2007 at 12:47:58AM +1000, Brett Randall wrote:
> G'day all
>
> I'm trying to get DBI::ProfileDumper::Apache working under mod_perl 2
> and am having no luck at all. I've followed the easy instructions as per
> the doc and put into my httpd.conf's <VirtualHost> section:
>
> PerlSetEnv DBI_PROFILE_APACHE_LOG_DIR /var/log/apache2
> PerlSetEnv DBI_PROFILE 2/DBI::ProfileDumper::Apache
> PerlOptions +GlobalRequest
>
> I've also tried replacing PerlSetEnv with SetEnv in case that might help
> and it doesn't. The symptom is that no dbi.prof files are created, and
> no errors are logged to error_log. Apache 2 starts normally but no joy
> with getting any Profile data out. I haven't tried ProfileDumper with
> mod_perl 2 up until now but have enjoyed success previously with
> mod_perl 1.
>
> I've performed an strace of httpd and see it load the
> DBI::ProfileDumper::Apache module when apache starts,
Assuming you don't explictly load DBI::ProfileDumper::Apache elsewhere
then that means the DBI_PROFILE env var is being recognised and processed.
It should then enable profiling for all driver loaded after the
env var is set. So be sure you're not explicitly loading the
driver, let DBI do that in a connect statement (or be sure to load it
after DBI_PROFILE has been set).
> but there is no attempt to open any dbi.prof files to write to.
The file gets written when the child process exits.
> Does anyone have any suggestions how I can debug this further and figure
> out why I cannot get it working?
Check the above. Then check $dbh->{Profile} is true.
(If you've still no joy I may be able to check a mod_perl2 setup in a
day or two.)
Tim.
> I am running Apache 2.2.3, mod_perl
> 2.0.2, Perl 5.8.8 and DBI 1.59 on a Debian Etch box. I was running
> factory Apache 2, MySQL, DBI and DBD modules that weren't working, then
> downloaded my own MySQL, DBI and DBD source packages, removed the
> prebuilt ones and built my own with the same end result (still factory
> Apache 2 though - yet to attempt my first Apache 2 compile from
> scratch).