PHP Mastery
This path takes you from PHP that works to reading an EXPLAIN plan without guessing, designing APIs other developers don't curse at, writing PHPStan rules that catch bugs before code review, and knowing when event sourcing is worth the complexity.
It's a curated list of books, video courses, conference talks and docs in 19 chapters. Chapters 1 to 11 run in order, from the language itself through object-oriented design, testing, architecture and DDD. Chapters 12 to 18 cover databases, APIs, security, servers and profiling: open the one that matches the problem in front of you. Chapter 19 collects the original books and talks the rest are built on.
You don't need every resource. Pick one per chapter and use it on a real project before you move on.
PHP Fundamentals
Chapter 1Write a small PHP 8 app without a framework: handle forms, cookies and sessions, talk to MySQL, and step through the code in a debugger when it breaks. Set up your editor and keep everything in Git from the first commit.
Programming Terms Explained
Know what the terms everyone assumes you know actually mean: networks, servers and clients, HTTP and HTTPS, routers and firewalls, bandwidth and laten...
Visual Studio Code for PHP Developers
Set up VS Code for PHP work: navigation, snippets, the built-in terminal, Git, automatic imports, running PHPUnit, formatting, and a four-minute debug...
Git Me Some Version Control
Use the Git commands you need every day: staging and committing, amending, branching, resolving merge conflicts, aliases, stashing, pushing to GitHub,...
The Git & Github Bootcamp
Know Git from the inside: blobs, trees and commits, branching and merging, diff, stashing, undoing with restore, revert and reset, pull requests and f...
Atlassian Git Tutorials
Look up any Git task when it comes up: setting up a repository, saving and undoing changes, rewriting history, pull requests, branching workflows like...
PHP For Beginners (2023 Edition)
Build a working PHP app by hand, starting from zero programming experience: a router, MySQL through PDO, protection against SQL injection, form valida...
Learn PHP The Right Way
Go from beginner to advanced PHP in one free series: the language, OOP, Composer and autoloading, PDO, PHPUnit and mocking, DI containers, enums and a...
PHP for the Web
Build your first web application in plain PHP: serve files and scripts, handle forms, cookies and sessions, add authentication, structure the project,...
Front Line PHP
Write PHP the way 8.x allows: the type system and static analysis, property promotion, readonly properties, named arguments, attributes, enums, match...
PHP Cookbook
Look up a recipe for an everyday PHP problem: variables, functions, strings, numbers, dates, arrays, classes, security and encryption, error handling,...
Xdebug Step Debugging docs
Get Xdebug's step debugger running for web requests and CLI scripts, connect it to your IDE, and fix it when it won't connect. Works with any IDE that...
Debugging with PhpStorm
Debug PHP from PhpStorm: install Xdebug 3, add the browser extension, make PhpStorm listen for connections, start a session, set breakpoints and step...
HTTP Fundamentals
Chapter 2Follow a request from the browser to your PHP code and back: what the request and response carry, what HTTPS adds, and why HTTP/2 and HTTP/3 exist. Then look up the parts your code depends on: status codes, caching, cookies, redirects and authentication.
HTTP Crash Course
Explain what happens on the wire when a browser talks to your server: requests and responses, how a web server handles them (with a live demo), what H...
HTTP: Hypertext Transfer Protocol
Look up how any part of HTTP works when your code depends on it: separate guides on caching, cookies (HttpOnly, Secure, SameSite), conditional request...
Object-Oriented Design
Chapter 3Write classes that each have one job, tell a service from a value object or a DTO, and apply the five SOLID principles to real PHP code. Recognise Decorator, Adapter, Strategy and Observer when a problem calls for one. The books then cover designing objects and splitting code into packages.
Object-Oriented Principles in PHP (2024 Edition)
Go from procedural PHP to classes you can reason about: objects, DTOs checked by static analysis, interfaces that loosen coupling, inheritance and com...
Design Patterns in PHP
Implement seven classic patterns in PHP across eight episodes: Decorator, Adapter, Template Method, Strategy, Chain of Responsibility, Specification a...
Every PHP Magic Method
Know what each PHP magic method does, from __construct to __set_state, including __get, __call and __invoke, with one short episode per method. 17 epi...
SOLID Principles in PHP
Apply each SOLID principle to PHP code, one episode per principle: single responsibility, open-closed, Liskov substitution, interface segregation and...
Don't Be STUPID, Grasp SOLID
Tell STUPID code from SOLID code: Ferrara sets the habits he groups under STUPID against the SOLID principles. Free, 48m, Northeast PHP 2013, with sli...
From Good to SOLID
See how a flexible PHP codebase drifts into tight coupling and how the SOLID principles pull it back. Shorter and gentler than Ferrara's talk. Free, 3...
Beyond Design Patterns and Principles
For when you know the pattern catalog and the SOLID checklist: Noback on what good object-oriented code looks like past both. Free, 41m, Forum PHP 201...
Extremely Defensive PHP
Write classes that are hard to misuse: immutable state, final classes by default, strict invariants and data validation, which Pivetta calls aggressiv...
Object Design Style Guide
Make the same good decision every time you design an object: how to construct services and other objects, define methods, change and expose state, and...
Principles of Package Design
Split code into packages worth reusing: SOLID applied to classes first, then the six package principles that decide which classes belong together and...
Testing
Chapter 4Know a stub from a mock and a dummy, write PHPUnit tests for your own code, and build the habit of writing the test first through katas. Then use mutation testing to find the tests that would miss a real bug.
PHP Testing Jargon
Know what each testing term means before you need it: unit tests, setup, data providers, refactoring on green, dummies, stubs versus mocks and the dow...
PHP Unit Testing with PHPUnit
Write PHPUnit tests from the first assertion to test doubles: fixtures, dependencies between tests, exceptions, mocks and stubs, test-driven developme...
Code Katas with PHPUnit
Make writing the test first a habit: two setup episodes, then eight katas solved test-first (Prime Factors, Roman Numerals, Bowling Game, String Calcu...
The Grumpy Programmer's Guide To Testing PHP Applications
Decide how much to test and how, from a long-time tester: "It's A Funnel, Not A Pyramid", customer versus developer tests, how PHPUnit works, test dou...
Design How Your Objects Talk Through Mocking
Test the messages your objects send each other: Kudryashov contrasts checking outcomes with checking messages, argues for the second, and shows how mo...
Mutation Testing in PHP
Find out whether your tests check anything: why code coverage can't tell you, how mutation testing measures it, and how to start with Infection. Free,...
Composer
Chapter 5Add a library to a project and know what Composer did: how version constraints pick a version, what the lock file pins, how PSR-4 autoloading finds your classes, and when a dependency belongs in require-dev. The official docs also cover scripts and publishing your own package.
Wonderful World of Composer
Add your first library with Composer: installing Composer, requiring a library, autoloading, what composer.lock is for, install versus update, and wha...
Composer Official Documentation
Look up anything Composer does: basic usage, the composer.json schema, versions and constraints, CLI commands, repositories and private packages (incl...
Understanding How Frameworks Work
Chapter 6Build a small framework yourself, one piece at a time: a container with autowiring, a router, controllers, views, service providers, middleware, CSRF protection, validation and auth. Once you've written those pieces, a Laravel or Symfony stack trace reads like code you know.
Build Your Own PHP Framework
Write the parts of a framework yourself and see how they connect: PSR-4 autoloading, a container with autowiring and service providers, config, routin...
Frontend Fundamentals for PHP Developers
Chapter 7Ship the frontend of a feature yourself: lay out pages with flexbox, grid and Tailwind, make them look deliberate with spacing, typography and hierarchy, and add JavaScript for DOM events, forms and fetch requests.
CSS Flexbox Simplified
Lay out real components with flexbox and know when to switch to grid: spacing and alignment, wrapping, direction, grow and shrink, the flex shorthand,...
Modern CSS for Backend Developers
Write the CSS a backend developer needs day to day: resets, flexbox layouts, card and pricing designs, refactoring to Tailwind, mobile-first layouts,...
HTML and CSS Workshop
Practise on a full design after the two courses above: build a blog's layout, post cards, newsletter section and post page in HTML and Tailwind, with...
Refactoring UI
Make an interface look designed without a designer: tactics for hierarchy, layout and spacing, text, color, depth, images and finishing touches, each...
JavaScript: The First Steps
Write JavaScript from zero: types, functions, conditionals, loops and scope, then the DOM (selecting and creating elements, events, bubbling and deleg...
JavaScript Essentials for PHP Developers
Write JavaScript using PHP as your reference point: syntax and scope, types, objects and classes, the DOM, events, forms, modules, browser storage, pr...
Architecture and Domain-Driven Design
Chapter 8Structure an application around its business rules: value objects and entities that protect their own rules, ports and adapters that keep the framework at the edge, and vertical slices as an alternative to layers. Then the tactical DDD patterns (aggregates, repositories, domain events) and bounded contexts for splitting a large domain. One book covers getting a legacy app into shape first.
Unbreakable Domain Models
Put business logic where it can't be bypassed: value objects and entities with tight consistency boundaries, repositories, encapsulated operations and...
Hexagonal Architecture
Keep the application core independent of the framework, the database and how requests arrive, with an introduction to hexagonal architecture (also cal...
Decoupling the Model from the Framework
Keep framework code out of your domain model, so the framework becomes a detail you could replace. Free, 54m, Laracon EU 2014. By Mathias Verraes on Y...
Vertical Slice Architecture, not Layers!
Group code by feature (vertical slices) so one change stays in one place, and see why layers spread a single feature across many folders. Free, 46m (2...
Modernizing Legacy Applications In PHP
Turn an include-based legacy PHP app into a testable one in small steps, while it keeps running: add an autoloader, replace globals and the new keywor...
Advanced Web Application Architecture
Decouple your core code from infrastructure: the domain model, read and view models, application services, external services, time and randomness, and...
Domain Driven Design in PHP
Implement the tactical DDD patterns in PHP: value objects, entities, services, domain events, modules, aggregates, factories, repositories and applica...
CQRS, Event Sourcing and Decoupling
Chapter 9Use separate models for changing data and reading it (CQRS), store every change as an event so you keep the history and not only the latest state (event sourcing), and use Event Storming to find those events. The books and talks cover read models, versioning events over time, decoupling from your framework, and the ways event-sourced systems fail in practice.
Event Sourcery Full Course
Model a domain from first principles and build it event-sourced: models, identity and consistency, entities and value objects, domain events, event-so...
CQRS and Event Sourcing Explained
Decide whether CQRS or event sourcing fits your project, with an introduction aimed at PHP developers. Free, 49m, IPC Spring 2018. By Stefan Priebsch...
Event Storming
The Event Storming workshop explained by Alberto Brandolini, who created it. Free, 51m, wroc_love.rb 2015. By Alberto Brandolini on YouTube.
A Decade of DDD, CQRS, Event Sourcing
For when you know CQRS and event sourcing and want the history: Greg Young, who coined the term CQRS, looks back on ten years of DDD, CQRS and event s...
CQRS and Event Sourcing
Explain CQRS and event sourcing from one question, "is your bank balance a column in a table?": why mature business domains record the facts that happ...
Why Event Sourced Systems Fail
Know how event-sourced systems fail before you build one: the downsides and common failure modes, from someone who has given hundreds of talks on the...
CQRS By Example
Build CQRS step by step on a Twitter clone in PHP: the command side and write model, the query side and read models, keeping them in sync, edge cases,...
Recipes For Decoupling
Decouple from each kind of dependency, one recipe per chapter: web frameworks, CLI frameworks, form validation, ORMs and test frameworks, after an ope...
Understanding Eventsourcing
Plan a system with Event Modeling, then build it event-sourced: an event model, CQRS and eventual consistency, stream design, sagas and vertical slice...
Versioning in an Event Sourced System
Change events after they're stored without breaking a running system: type-based versioning, weak schema, mapping, upcasting, snapshots, compensating...
CQRS Documents
Read the original long-form case for CQRS and event sourcing: task-based UIs, splitting commands from queries, events as the storage mechanism, buildi...
Automated Refactoring and Code Quality
Chapter 10Upgrade a codebase across PHP versions with Rector, write your own Rector rules for project-specific refactors, and tighten PHPStan level by level until it fails the build on the architectural mistakes you care about.
Refactoring Huge Legacy PHP Applications
See how Rector applies one refactoring rule across thousands of files: what an abstract syntax tree is and how Rector uses it, shown on a Symfony 3 to...
Tuning PHPStan to Maximum Strictness
Raise PHPStan's strictness step by step: its rule levels and the configuration options beyond them, with examples of what each one changes in your cod...
Crafting Custom PHPStan Rules
Write your own PHPStan rules to enforce project conventions, catch bugs specific to your domain, and take repetitive checks out of code review. Free,...
Rector, The Power of Automated Refactoring
Write your own Rector rules and run Rector continuously: parsing PHP into an AST, your first rule, test-driven rule development, and keeping Rector in...
Distributed Systems and Microservices
Chapter 11Decide whether splitting a system into services is worth it. One talk shows what it cost a team that got a lot wrong; the book shows how to choose between a modular monolith and separate services from what the business needs.
Microservices Gone Wrong
Hear what microservices cost one team before you split your own system: what worked, what didn't, and what they learned. In Ferrara's words, "we got a...
Strategic Monoliths and Microservices
Choose, together with the business side, between a modular monolith, microservices or something in between, based on what the business needs, and brea...
Databases
Chapter 12For the slow query or the table that locks up: read the EXPLAIN plan, pick the index that fixes it, rewrite the query, and understand which locks and transaction isolation levels are in play. General SQL first, then one course for SQLite and separate tracks for PostgreSQL and MySQL, from a first course to a performance book.
Advent of SQL
Sharpen your SQL on 15 days of challenges that get harder as they go, each with a new dataset and a video solution. Try each day before you watch it....
The Database Cookbook For Developers
Use the database features most application code never touches, in 41 short recipes: returning modified rows, deleting duplicates, pagination faster th...
Minimum Viable SQL Patterns
Keep SQL readable as queries grow: thinking in granularity, modular queries, DRY and single responsibility applied to SQL, simple WHERE clauses, and h...
High Performance SQLite
Run SQLite in production: internals and the file format, schema, tuning, indexes, advanced SQL, operations, JSON and full-text search. Several videos...
Learn PostgreSQL Full Course
Write your first SQL against PostgreSQL: create databases and tables, CRUD, filtering, joins, dates, aggregate functions, sequences, constraints and e...
Intro to Postgres
Query, change and index a Postgres database: filtering, joins, inserts, updates and upserts, JSON, table design with data types and constraints, and i...
Mastering Postgres
Get the most out of Postgres: data types and advanced types, indexing and advanced indexing, reading query plans, advanced SQL, full-text search, JSON...
The Art of PostgreSQL
Replace application code with SQL: window functions, CTEs, aggregates, indexing strategy, normalization and concurrency, with a lab to run the queries...
MySQL for Developers
Design MySQL tables and indexes that keep queries fast: schema and data types, indexing, writing queries that use your indexes, and worked examples li...
MySQL Cookbook (4th Edition)
Look up a worked solution for a MySQL task: more than 200 recipes for MySQL 5.7 and 8.0, covering the mysql client and MySQL Shell, replication, progr...
Efficient MySQL Performance
Make MySQL fast as a software engineer, without DBA internals: query response time as the main metric, indexing for common clauses and joins, data, ac...
MySQL 8 Query Performance Tuning
Find and fix slow queries in MySQL 8 with a step-by-step method: monitoring, picking candidates, analyzing them with EXPLAIN, EXPLAIN ANALYZE and Visu...
MySQL Concurrency
Diagnose lock waits and deadlocks: lock types from table locks down to record and gap locks, how they interact with transactions and isolation levels,...
High Performance MySQL (4th Edition)
Operate MySQL at scale: architecture, monitoring and service-level objectives, Performance Schema, OS and server tuning, schema and index design, quer...
APIs
Chapter 13Building an API other developers will depend on: consistent endpoints and status codes, error responses that say what went wrong, authentication, pagination, and versioning so existing clients keep working.
Build APIs You Won't Hate
Build an API end to end: planning endpoints, input and output, status codes and errors, endpoint testing, relationships, debugging, authentication, pa...
PHP Web Services: APIs for the Modern Web
Build and debug HTTP services in PHP: HTTP verbs, headers and cookies first, then JSON and XML, RPC and SOAP, REST, webhooks, debugging, and designing...
Security
Chapter 14Before you ship code that takes user input: find and fix XSS, CSRF, SQL injection, and cookie and session mistakes, store passwords properly, and lock down php.ini. For a new feature, think through what can go wrong before you build it.
PHP Security
Spot and fix common PHP security mistakes in short demos: include file extensions, XSS, password hashing, directory listing, HttpOnly cookies, what no...
PHP 8 Web Application Security
Secure a PHP 8 application against the common attacks: input validation, XSS, SQL injection, session and state management, CSRF, password storage and...
OWASP PHP Configuration Cheat Sheet
Harden php.ini setting by setting: error handling, general settings, file uploads, executable handling and sessions, plus the Snuffleupagus hardening...
Threat Modeling Cheat Sheet
Think through what can go wrong with a feature before you build it: the four-question process, data flow diagrams, STRIDE for finding threats, and the...
Regular Expressions
Chapter 15For matching, validating and cleaning up text: read a pattern someone else wrote, write your own with PHP's preg functions, and test it before it goes into code.
Understand Regular Expressions
Read and write regex patterns: the big picture, alternation, character sets, greediness, and lookaheads and lookbehinds, with a final episode on PHP's...
regex101
Test a pattern before it goes into code: paste it with sample text, pick the PCRE2 (PHP) flavor, and see each match highlighted and each part explaine...
RegexLearn
Practise regex step by step, from the first character match to advanced patterns, in interactive lessons, plus a cheatsheet and a playground. Free and...
Linux, Servers and Docker
Chapter 16Once your code has to run somewhere other than your laptop: get around a Linux server from the command line, set up Nginx and SSL, and package your PHP app with Docker and Docker Compose. Two of the longer courses go on to Kubernetes.
Linux Survival
Get around a Linux shell in your browser with nothing to install: the directory structure, moving around, viewing, copying and removing files, permiss...
The Linux Command Line Bootcamp
Go from first commands to command line power user: navigation, files, permissions, redirection, pipelines, keyboard shortcuts, scheduling jobs with cr...
The Linux Command Line
Work in the shell and script it: the basics, the programs you run every day, and shell scripting, in a full book for new command line users. Free PDF...
Servers for Hackers
Run your own servers as a developer: users and permissions, package managers, security, web servers, SSL, multi-server setups, caching, logs, deployme...
Docker and PHP Complete Tutorial
Containerize a PHP app from scratch: Compose, the PHP Dockerfile, Nginx, MySQL, Composer, environment variables, Redis, Xdebug, multi-stage builds, a...
Dockerizing Your Application
Develop locally with Docker Compose: building project images, a flexible Compose file, the day-to-day workflow, and using Compose in CI for faster tes...
Shipping Docker
Take Docker from your laptop to production: images, Compose, CI with GitHub Actions and Jenkins, a single-host production setup, Swarm, BuildKit, prod...
Docker & Kubernetes: The Practical Guide
Run multi-container apps with Docker and Kubernetes: images and containers, volumes, networking, Compose, deployment, and Kubernetes from the ground u...
Profiling and CI/CD
Chapter 17When a page is slow or deploys are still manual: profile the request with Xdebug or Blackfire to see where the time goes, then set up GitHub Actions to run your tests and deploy on every push.
Xdebug Profiler docs
See which functions take the time in a request: turn on Xdebug's profiler, trigger it for a single request, and open the output in KCacheGrind or QCac...
Blackfire docs
Know what Blackfire can do before you pay for it: profiling single requests, monitoring production, continuous profiling, and performance tests in CI....
GitHub Actions Tutorial
Set up a first CI pipeline with GitHub Actions: events, workflows and actions, then a demo that builds a Java project and pushes a Docker image. Swap...
Automating Our Tests With GitHub Actions
Run a PHP project's tests on every push and pull request: a workflow that validates composer.json, caches dependencies, runs PHPUnit and repeats acros...
GitHub Actions: The Complete Guide
Build GitHub Actions workflows for any trigger: CI/CD with runtime configuration and conditional execution, custom actions, and securing workflows. Pa...
Beyond the Request Model
Chapter 18PHP that does more than answer one request and exit: fibers, event loops and promises with ReactPHP, long-running concurrent servers with Swoole's coroutines, and a functional style with pure functions, currying, and map, filter and reduce.
Fibers
Know what a Fiber is before you use a library built on them: an interruptible function with its own call stack, how it differs from a generator, and s...
Learning Event-Driven PHP With ReactPHP
Build event-driven PHP with ReactPHP: asynchronous versus parallel code, the event loop and its ticks, timers, streams, promises, a socket chat server...
Mastering Swoole PHP
Run PHP as a long-lived concurrent server: concurrency, async I/O and event loops, the Linux basics underneath (processes, threads, coroutines, socket...
Thinking Functionally in PHP
Write PHP in a functional style: pure and first-class functions, memoization, currying, map, filter and reduce, recursion and immutable value objects,...
Going to the Source
Chapter 19When an idea from the earlier chapters clicks and you want the original: Evans and Vernon on DDD, Fowler on enterprise patterns and refactoring, the Gang of Four on design patterns, Feathers on legacy code, Ousterhout on module design, Nygard on production stability, Hickey on simplicity, and Fowler's short definitions of CQRS, event sourcing, bounded contexts and aggregates.
Domain-Driven Design: Tackling Complexity in the Heart of Software
Go to the book that named Domain-Driven Design: ubiquitous language, the building blocks (entities, value objects, aggregates, repositories), and stra...
Implementing Domain-Driven Design
Apply DDD on real projects, strategic design first: bounded contexts and context maps, then architecture, entities, value objects, domain events, aggr...
Patterns of Enterprise Application Architecture
Trace names like Repository, Data Mapper and Unit of Work to their source: a 100-page tutorial on layering an enterprise application, then about forty...
Design Patterns
Read the original catalog of 23 object-oriented design patterns, each with its intent, structure and consequences. Examples are in C++ and Smalltalk....
Refactoring (2nd Edition)
Change code in small steps that keep it working: code smells, why tests come first, and a catalog of around seventy refactorings, each with motivation...
Clean Architecture
Keep use cases independent of frameworks and databases: the dependency rule, component principles and boundaries. Martin presents it as an attempt at...
A Philosophy of Software Design (2nd Edition)
Manage complexity with deep modules: information hiding, deep versus shallow modules, and strategic versus tactical programming. Its advice on method...
Working Effectively with Legacy Code
Get untested code under test so you can change it safely: finding seams, writing characterization tests, and a catalog of dependency-breaking techniqu...
Release It! (2nd Edition)
Design software that survives production: the stability antipatterns that take systems down, stability patterns like circuit breakers, then deployment...
Simple Made Easy
Tell simple from easy when you choose a design: Hickey separates "simple" (one concern, not tangled with others) from "easy" (familiar, close at hand)...
Growing a Language
Design an API its users can extend: Steele on designing a language its users can grow, delivered using only one-syllable words until he has defined lo...
The Language of the System
Design how services talk to each other: what serves as the language between them, why objects make poor messages, and building system services around...
CQRS
The short definition of CQRS: one model to update information and a different one to read it. Fowler credits Greg Young and warns that "for most syste...
Event Sourcing
The original short description of event sourcing: store every change to application state as an event, so you can rebuild past states and correct even...
Bounded Context
Split a large model the DDD way: each bounded context gets its own consistent model, and the relationships between them are explicit. A short article...
DDD Aggregate
Know what an aggregate is: a cluster of domain objects treated as one unit, like an order and its line items, with outside code referencing only its r...
The Twelve-Factor App
Check an app against twelve rules for deploying cleanly: one codebase, explicit dependencies, config in the environment, backing services as attached...