"It works on my machine" is not a PHP version. The same plugin runs locally and white-screens on the client's host. Different PHP, a different memory_limit, a stale OPcache. In this module you learn the path every request takes and where to look first when it breaks.
| Course | PHP for WordPress Developers ยท Module 1 of 9 ยท Stage 1 "Language" |
| Learn | How WordPress runs PHP, why hosts differ and how to debug with WP_DEBUG, logs and Xdebug |
| How | Short lessons with code from real plugins, Terminal practice in the browser, interview questions after every lesson |
The idea in one picture
flowchart LR
R["HTTP request"] --> W["Web server<br/>nginx ยท Apache"]
W --> F["PHP-FPM<br/>php.ini limits"]
F --> O["OPcache<br/>compiled code"]
O --> L["wp-load.php<br/>WordPress"]
classDef step fill:#f5f3ff,stroke:#777BB4,color:#1e1b4b
classDef key fill:#777BB4,stroke:#4f5b93,color:#ffffff
One request, four stops. Each one has its own settings, and each one can be the reason a plugin breaks on a client's host.
Before โ after
| Before | After Module 1 |
|---|---|
| "It works locally" โ and nothing more | You compare PHP version, limits and OPcache first |
| A white screen and no idea why | WP_DEBUG_LOG and error_log show the cause |
var_dump() on production | Xdebug and logs locally |
No Requires PHP in the plugin | The header protects old sites from a fatal error |
You'll be able to answer
- What is PHP-FPM and how does it differ from mod_php?
- What does OPcache do and when do you need to reset it?
- Why should a plugin declare
Requires PHP?