Once Pionia Shop works locally, this section covers how to run and ship it — from php pionia serve on port 8000 to RoadRunner workers, OPcache preload, and zero-downtime deploys for Pionia Shop.
Who this is for
You have a working Pionia Shop API (product, customer, order, wallet services) and need to operate it in dev and production — CLI commands, persistent workers, logs under storage/logs/, and deploy-time optimization without rewriting application code.
What you will learn
- Which CLI commands you run daily vs only on deploy
- How to move from the built-in server to RoadRunner workers
- Where to configure caching, logging, maintenance mode, and
/statsmetrics
- Pionia Shop tutorial Step 1 — Pionia Shop running locally
- Application structure —
storage/,environment/settings.ini
How it works
flowchart LR Dev["php pionia serve :8000"] --> RR[php pionia runserver] RR --> Opt[php pionia optimize --production] Opt --> Ship[Deploy + restart workers] Ship --> Obs["Logs / stats / cache"]
Development uses a single-process PHP server. Production adds persistent workers, optional OPcache preload, shared cache stores, and observability — all configured in your app, not in framework vendor code.
Daily commands
| Task | Guide |
|---|---|
| CLI overview | Commands |
| Schema changes | Migrations |
| Warm microbenchmarks | Benchmarking |
| Persistent workers | RoadRunner |
| Deploy checklist | Production performance |
| Zero-downtime deploys | Maintenance mode |
Observability & background work
| Task | Guide |
|---|---|
| Logs | Logging |
| Request metrics | Developer stats |
| Post-response jobs | Background work |
| Cache stores | Caching |
Production checklist
composer install --no-dev -o
php pionia migrate
php pionia optimize --production
php pionia runserver --detach
curl -s http://127.0.0.1:8000/api/v1/pingCommon mistakes
- Running
optimizeon every code change — use it at deploy time; local dev does not need preload or bootstrap caches. - Expecting
php pionia serveto match production — HTTP/1 only, no job queue; use RoadRunner for production-like testing. - Forgetting to restart workers after deploy when
opcache.validate_timestamps=0— stale bytecode until FPM/RR reload. - Leaving
/statsopen in production withoutSTATS_TOKEN— see Developer stats.
What’s next
Commands
Daily CLI and make:* scaffolds.
Benchmarking
php pionia bench microbenchmarks.
RoadRunner
Persistent workers and Moonlight jobs.