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
160
Design a REST API you will love to work with
ujovlado
0
790
Docker for PHP developers - Tips, Tricks & Lessons learned
ujovlado
3
510
Docker ‐ from development to production in minutes (PoSobota #91)
ujovlado
0
410
Non-traditional use of Docker (Nette Camp #3)
ujovlado
0
170
Contributions [lightning talk] (PyconCZ 2015)
ujovlado
0
120
CSS Flexbox (WebElement #35)
ujovlado
0
190
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
飯MCP
yusukebe
0
410
[PHPerKaigi 2026]PHPerKaigi2025の企画CodeGolfが最高すぎて社内で内製して半年運営して得た内製と運営の知見
ikezoemakoto
0
310
AIコードレビューの導入・運用と AI駆動開発における「AI4QA」の取り組みについて
hagevvashi
0
570
Windows on Ryzen and I
seosoft
0
430
Fundamentals of Software Engineering In the Age of AI
therealdanvega
2
300
車輪の再発明をしよう!PHP で実装して学ぶ、Web サーバーの仕組みと HTTP の正体
h1r0
2
440
ローカルで稼働するAI エージェントを超えて / beyond-local-ai-agents
gawa
1
180
Smarter Angular mit Transformers.js & Prompt API
christianliebel
PRO
1
100
20260320登壇資料
pharct
0
140
PHP でエミュレータを自作して Ubuntu を動かそう
m3m0r7
PRO
2
150
Claude Codeログ基盤の構築
giginet
PRO
7
3.7k
ファインチューニングせずメインコンペを解く方法
pokutuna
0
210
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Paper Plane (Part 1)
katiecoart
PRO
0
6.1k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
Automating Front-end Workflow
addyosmani
1370
200k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
300
First, design no harm
axbom
PRO
2
1.1k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.1k
Building Adaptive Systems
keathley
44
3k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
91
Six Lessons from altMBA
skipperchong
29
4.2k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
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?