Documentation · Chapter 16

Prepare an application for hostile reality.

Production differs from a laptop: debug output is off, secrets are external, concurrency is real, processes restart, and logs must explain failures.

Every lesson starts from the problem, explains the mechanism, then gives a concrete verification.

LESSON OBJECTIVE

What you will be able to do

Prepare production configuration, observability, backups, and recovery rather than checking only a happy path.

Disable debug information

APP_DEBUG=false and generic public errors prevent internal paths and stack traces from becoming responses. Keep full context in protected logs.

phpaml — zsh
APP_DEBUG=false aml doctor --production --json
composer audit
aml routes

Check security and observability

Run doctor --production, dependency audit, route review, permission checks, backups, and a health endpoint. Attach request IDs to logs.

Practice recovery

Restore a backup, roll back one release, rotate one secret, and restart one process before an incident forces you to learn.

CHECKPOINT

Before you continue

Has the team actually restored a backup and rolled back a release, or merely documented the commands?