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
Power Debugging & Profiling Your PHP Apps
Search
Abu Ashraf Masnun
January 12, 2023
Programming
0
64
Power Debugging & Profiling Your PHP Apps
Abu Ashraf Masnun
January 12, 2023
Tweet
Share
More Decks by Abu Ashraf Masnun
See All by Abu Ashraf Masnun
Background Task Processing in Celery
masnun
1
60
REST API Development
masnun
0
76
Golang For Scalable Systems
masnun
0
81
Email Validation using SMTP
masnun
0
69
Let's Get Going!
masnun
0
120
How to be Successful in Outsourcing
masnun
1
100
Other Decks in Programming
See All in Programming
GitHub Actionsで泣かないためにやっておきたい設定 / Recommended GHA settings to avoid crying
pinkumohikan
3
490
Ruby GitHub Packages
bkuhlmann
0
620
CQRS/ES avec Symfony, c’est (trop) bien !
jeremyfreeagent
1
630
ゆるい個人開発のススメ
kuroppe1819
10
950
App Router への移行は「改善」となり得るのか?/ Can migration to App Router be an improvement
takefumiyoshii
8
2.1k
try! Swift Tokyo 2024 参加報告 / try! Swift Tokyo 2024 Report
hironytic
0
180
今、知っておきたい! 生成AIエージェントの世界
elith
3
340
Elm Form Validation
bkuhlmann
0
510
二郎系ラーメンのコールで学ぶ AST 解析
memory1994
PRO
7
1.7k
データアナリストが行うDatabricksを活用したETLの自動化事例
shinoa
0
250
ADRを一年運用してみた/adr_after_a_year
hanhan1978
7
2.2k
Site Reliability Engineering for GMO
pyama86
6
960
Featured
See All Featured
Docker and Python
trallard
33
2.7k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
12
1.5k
Typedesign – Prime Four
hannesfritz
36
2.1k
Testing 201, or: Great Expectations
jmmastey
27
6.3k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
How to train your dragon (web standard)
notwaldorf
72
5.1k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3k
No one is an island. Learnings from fostering a developers community.
thoeni
14
2.1k
Designing the Hi-DPI Web
ddemaree
276
33k
Git: the NoSQL Database
bkeepers
PRO
422
63k
Optimizing for Happiness
mojombo
370
69k
Imperfection Machines: The Place of Print at Facebook
scottboms
258
12k
Transcript
Power Debugging & Profiling Your PHP Apps Abu
Ashraf Masnun
WHAT’S YOUR STORY? Let’s share experiences!
Error Display • Turn on error display
• Report all errors • E_ALL | E_STRICT • Don’t ignore those “NoKce” messages
Print & Die • Output something and then terminate
the script. • var_dump() • print_r() • Output buffering for cleaner output • debug_backtrace()
Logging • Use a logging library (Monolog, anyone?)
• error_log() • mod_php sets stderr to apache logs: – file_put_contents('php://stderr', print_r($foo, TRUE)) • trigger_error() & set_error_handler() Tail your logs: tail -‐f your_log_file_path
InteresKng Tools • FirePHP, Chrome Logger • Kint,
PHP Debug Bar
THE MOTHER OF ALL DEBUGGER Let’s meet
ConfiguraKon
Netbeans
Netbeans
Netbeans
PROFILING LIKE A PRO
Start Profiling
The Cachegrind Files
Using Webgrind
@MASNUN Feel free to reach out: hap://masnun.me