Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Xdebug / debugging PHP applications (WebElement...
Search
Vladimír Kriška
December 08, 2011
Programming
320
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Xdebug / debugging PHP applications (WebElement #2)
Vladimír Kriška
December 08, 2011
More Decks by Vladimír Kriška
See All by Vladimír Kriška
Twelve-Factor app with Docker
ujovlado
0
200
Design a REST API you will love to work with
ujovlado
0
830
Docker for PHP developers - Tips, Tricks & Lessons learned
ujovlado
3
540
Docker ‐ from development to production in minutes (PoSobota #91)
ujovlado
0
450
Non-traditional use of Docker (Nette Camp #3)
ujovlado
0
210
Contributions [lightning talk] (PyconCZ 2015)
ujovlado
0
160
CSS Flexbox (WebElement #35)
ujovlado
0
220
Simplify your dev life with Docker (WebElement Banská Bystrica)
ujovlado
0
220
Don't underestimate CSS (WebElement #30)
ujovlado
0
660
Other Decks in Programming
See All in Programming
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
290
Performance Optimization With LLMs
xleitix
0
240
PyConTW 2026 - AI Coding 不只是工具升級, 區域醫院醫療資訊系統協作開發與資訊團隊轉型實踐
cclai999
0
240
AI時代のTerminal環境を UNIX哲学で設計・運用する
yasunori0418
1
350
Goコンパイラを作ってGoをもっと理解する / Build a Go compiler to better understand Go
ikura_hamu
0
120
Getting Started with Vibe Coding
miccheng
0
190
Crash Auto Pipelines
veronikapj
1
390
オーケストレーション記述言語 Katari
yukikurage
0
240
React Native에 현대적인 빌드 도구 더하기: Rollipop 구현기
leegeunhyeok
0
180
AI Augmentation Techniques with Liberty
ivargrimstad
1
400
baseline으로 마이그레이션, 리팩토링 안전하게 맡기기
fornewid
1
930
Spec-driven Development with AI
simas
PRO
0
2.3k
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
37
4k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Odyssey Design
rkendrick25
PRO
2
930
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
520
Color Theory Basics | Prateek | Gurzu
gurzu
1
510
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
310
Code Reviewing Like a Champion
maltzj
529
40k
The Language of Interfaces
destraynor
162
27k
Producing Creativity
orderedlist
PRO
348
41k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
550
Tell your own story through comics
letsgokoyo
1
1.1k
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?