Manual talk:How to debug/Archive 1

Dumping variables
Is there a dump routine in MediaWiki? Since MediaWiki stores HTML for output, var_dump isn't working for me. This is a useful topic for this page. -- skierpage 01:11, 29 April 2006 (UTC)

This information does not work for MediaWiki 1.9 using the provided example. Does anyone have an up to date instructions? It would also be helpful if version information was included when providing examples.


 * There is also the useful '$wgDebugComments' variable. &#91;user:jldupont] 14:11, 1 July 2007 (UTC)

profileinfo.php
When I try to browse to /profileinfo.php, I get a blank page. Judging by the source of said file, even if profiling is disabled, there should still be something there. I don't even get any HTML let alone visible content. Any ideas?


 * See Manual:Errors and Symptoms. Is that the problem?  --Cneubauer 19:55, 29 May 2008 (UTC)

Stack Backtrace
Is there a way to get a full stack backtrace with MediaWiki, or do I have to use PHP's Advanced PHP debugger? —Sledged (talk) 16:54, 19 October 2007 (UTC)


 * You can use the wfDebug functions  and  .  You basically put those in your code somewhere to get your backtrace.  If you use the Die one, it will error out to the screen.  The other writes to your debug log.  See GlobalFunctions.php for more information.  --Cneubauer 19:52, 29 May 2008 (UTC)

What are these table columns?
Has anyone ever bothered to document these table columns somewhere?:

Calls        Total          Each             %       Mem      (and three more without headings)


 * Is Calls DB calls, function calls, something else?
 * Total what?
 * What is the content of the three unlabelled columns?

--Michael Daly 06:18, 13 April 2008 (UTC)


 * Just taking a shot at this, but it looks like Calls is the number of times a code block that is surrounded by a wfProfileIn/wfProfileOut pair is encountered. This roughly translates to function calls but in some cases may be smaller pieces like loops within functions that someone chose to add profile info to.


 * Total is the time that it took to run through that part of the code. Not sure what the units are.  Maybe microseconds as the profiler uses microtime.  Each is the amount of time spent in one visit to that code.  So Calls * Each = Total.  % is the percent of total code execution spent in that code block.  Mem is the amount of memory used in the code block?  I get negative numbers for some of that column though so...


 * The two numbers in parens seem to be the min and max of something. Possibly the min and max execution time for all runs through that Call.  The last number is the overhead of something.  Maybe of running the profiler?  It would be great if the developers took time to write up some documentation on things like this but they are unfortunately pretty universally of the school that coding is more important then documenting.  --Cneubauer 19:48, 29 May 2008 (UTC)

Missing information

 * Shouldn't this article (rather than the talk page) include reference to  and  ? I knew about the former but only discovered the latter from this talk page.