• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
WebElement #2 - Xdebug, debugging PHP applications
 

WebElement #2 - Xdebug, debugging PHP applications

on

  • 1,863 views

http://www.webelement.sk/event/webelement-2

http://www.webelement.sk/event/webelement-2

Statistics

Views

Total Views
1,863
Views on SlideShare
1,603
Embed Views
260

Actions

Likes
1
Downloads
0
Comments
0

11 Embeds 260

http://www.php-talks.com 87
http://www.webelement.sk 75
http://webelement.sk 49
http://webelement.loc 20
http://event.webelement.sk 16
http://localhost 6
http://www.phptalks.de 2
http://a0.twimg.com 2
http://phptalks.localhost 1
http://lanyrd.com 1
http://webelement.posterous.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    WebElement #2 - Xdebug, debugging PHP applications WebElement #2 - Xdebug, debugging PHP applications Presentation Transcript

    • Xdebugdebugging PHP applications WebElement event #2, 08.12.2011 Vladimír Kriška, @ujovlado
    • “I Dont Need A Debugger”● Chuck Norris doesnt● for everyone else is XdebugThese functions are insufficient: ● echo ● print_r() ● var_dump()… or yours framework built-in functionsAnd you probably use them with <pre> tag.
    • Xdebug● Open Source debugging tool https://github.com/derickr/xdebug● Easy to configure● Easy to use● Works on every platform● Nice, colored output
    • Initial configuration● html_errors = On● zend_extension=/path/to/xdebug.so e.g.: /usr/lib/php5/20090626/xdebug.so
    • Lets startHow much to show: ● xdebug.var_display_max_children (128) ● xdebug.var_display_max_data (512) ● xdebug.var_display_max_depth (3)Xdebug overloads var_dump() by default.
    • Example code
    • Output
    • Stack trace - code
    • Stack trace - output
    • Function trace - code
    • Function trace - output file
    • Code coverageDetect which lines of script was executed.Three functions: ● xdebug_start_code_coverage() ● xdebug_stop_code_coverage() ● xdebug_get_code_coverage()
    • Code coverage - code
    • Code coverage - output
    • Tracefile analyserSet xdebug.trace_format=1tracefile-analyser.php tracefile.xt [sortkey][elements]Available sortkeys: ● calls ● time-inclusive ● memory-inclusive ● time-own ● memory-own
    • ProfilingSet:xdebug.profiler_enable=1xdebug.profiler_output_dir=/var/www/xdebug/tmpGenerates cachegrind file.Tools: ● KCachegrind ● Webgrind
    • Debuggingxdebug.remote_enable=1xdebug.remote_handler=dbgpxdebug.remote_mode=reqxdebug.remote_host=127.0.0.1xdebug.remote_port=9000
    • “Scream” modexdebug.scream=1Set this to disable the “@” operator. All errors,warnings and notices will be visible.
    • Some new features in 2.2xdebug.cli_color- colored output in CLI modexdebug.coverage_enable- if you turn this off, it speeds up Xdebug, butcoverage analysis wont work
    • ResourcesXdebug home page- http://xdebug.org/Derick Rethans- http://derickrethans.nl/
    • Thank you! Any questions?