Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Xdebug / debugging PHP applications (WebElement...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Vladimír Kriška
December 08, 2011
Programming
0
280
Xdebug / debugging PHP applications (WebElement #2)
Vladimír Kriška
December 08, 2011
Tweet
Share
More Decks by Vladimír Kriška
See All by Vladimír Kriška
Twelve-Factor app with Docker
ujovlado
0
150
Design a REST API you will love to work with
ujovlado
0
780
Docker for PHP developers - Tips, Tricks & Lessons learned
ujovlado
3
510
Docker ‐ from development to production in minutes (PoSobota #91)
ujovlado
0
400
Non-traditional use of Docker (Nette Camp #3)
ujovlado
0
160
Contributions [lightning talk] (PyconCZ 2015)
ujovlado
0
120
CSS Flexbox (WebElement #35)
ujovlado
0
180
Simplify your dev life with Docker (WebElement Banská Bystrica)
ujovlado
0
190
Don't underestimate CSS (WebElement #30)
ujovlado
0
620
Other Decks in Programming
See All in Programming
QAフローを最適化し、品質水準を満たしながらリリースまでの期間を最短化する #RSGT2026
shibayu36
2
4.4k
AIによる高速開発をどう制御するか? ガードレール設置で開発速度と品質を両立させたチームの事例
tonkotsuboy_com
7
2.3k
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
160
それ、本当に安全? ファイルアップロードで見落としがちなセキュリティリスクと対策
penpeen
7
3.9k
Fluid Templating in TYPO3 14
s2b
0
130
Oxlintはいいぞ
yug1224
5
1.3k
dchart: charts from deck markup
ajstarks
3
990
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
690
Grafana:建立系統全知視角的捷徑
blueswen
0
330
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
690
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
2.5k
CSC307 Lecture 06
javiergs
PRO
0
680
Featured
See All Featured
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
290
The Limits of Empathy - UXLibs8
cassininazir
1
210
WENDY [Excerpt]
tessaabrams
9
36k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.1k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.6k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
640
Building Applications with DynamoDB
mza
96
6.9k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
14k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
117
110k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
Navigating Weather and Climate Data
rabernat
0
100
Transcript
Xdebug debugging PHP applications WebElement event #2, 08.12.2011 Vladimír Kriška,
@ujovlado
“I Don't Need A Debugger” • Chuck Norris doesn't •
for everyone else is Xdebug These functions are insufficient: • echo • print_r() • var_dump() … or your's framework built-in functions And 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
Let's start How 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 coverage Detect 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 analyser Set xdebug.trace_format=1 tracefile-analyser.php tracefile.xt [sortkey] [elements] Available sortkeys:
• calls • time-inclusive • memory-inclusive • time-own • memory-own
None
Profiling Set: xdebug.profiler_enable=1 xdebug.profiler_output_dir=/var/www/xdebug/tmp Generates cachegrind file. Tools: • KCachegrind
• Webgrind
Debugging xdebug.remote_enable=1 xdebug.remote_handler=dbgp xdebug.remote_mode=req xdebug.remote_host=127.0.0.1 xdebug.remote_port=9000
“Scream” mode xdebug.scream=1 Set this to disable the “@” operator.
All errors, warnings and notices will be visible.
Some new features in 2.2 xdebug.cli_color - colored output in
CLI mode xdebug.coverage_enable - if you turn this off, it speeds up Xdebug, but coverage analysis won't work
Resources Xdebug home page - http://xdebug.org/ Derick Rethans - http://derickrethans.nl/
Thank you! Any questions?