Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: modperl debugger

by rhymejerky (Beadle)
on Aug 23, 2008 at 00:27 UTC ( [id://706349]=note: print w/replies, xml ) Need Help??


in reply to Re: modperl debugger
in thread modperl debugger

Thanks for the info. It doesn't necessary have to be a a GUI. I am just unsure about how to debug when I load up a web page and have some input (ie select some items or click on some links etc). I have use perl -d to debug scripts, but never try it when a web page is involved. So, just curious how other people do it

Replies are listed 'Best First'.
Re^3: modperl debugger
by trwww (Priest) on Aug 23, 2008 at 08:40 UTC

    You want Apache::DB.

    Put the following in your httpd.conf:

    # conditionally load the perl debugger <IfDefine PERLDB> <Perl> use Apache::DB (); Apache::DB->init; </Perl> <Location /> PerlInitHandler Apache::DB </Location> </IfDefine>

    Then start apache like so:

    /path/to/apache/bin/httpd -X -D PERLDB

    Instead of returning to the terminal like it usually does, the perl debugger will start. Then you can browse around your site. Now you can set breakpoints, step through code, inspect variables, or whatever.

    The only way I've found to stop the debugger is with kill -9 PID, so you'll need another terminal.

    If you are using mp2, there are a couple additional settings you need. See the link above or run perldoc Apache::DB for the details.

    Hope this helps,

    trwww

      Great info, I am able to see the debugger showing the lines executed as I load a page. However, once I am done loading a page, the httpd process exit and I will have to restart the httpd again if I want to access another page. I know in the perl code, there are various places with "exit" Is this the reason combining with running httpd in single process mode cause this?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2024-04-16 11:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found