▙▟▗▄▄▄▄▄▖▙▟
▝█▄███▄█▘
Make PHP great again
Fast to run, easy to use, and small enough to understand. Crab gives long-lived PHP applications a clear foundation for JSON APIs, services, and the work around them.
composer create-project crabphp/crab my-app
cd my-app
php cua dev
Fast to run. Easy to use.
- Fast
- The application loads once and serves requests as a real server. No PHP-FPM, no bootstrapping on every request.
- Easy
- Typed actions, named services, ordinary PHP. One way to do each thing keeps the important parts visible.
- Built-in
- Routing, validation, databases, queues, scheduling, authentication, HTTP, streaming, and WebSockets on one small foundation.
Built with CrabPHP
Not just example routes. Real software, built on the same foundation.
Bia — a coding agent for your terminal
Read the code, make the change, run the tests. Bia works in your project with your choice of model, streams its replies, and saves the conversation so you can pick it up later. Written in PHP, powered by Crab's engine.
Benchmarks
| Framework / server | Hello | Database |
|---|---|---|
| Crab 0.6.4 Native server | 108,522 | 20,240 |
| webman 2.2.5 Workerman | 73,282 | 8,301 |
| Hyperf 3.2.0 Swoole | 41,652 | 9,380 |
| ReactPHP HTTP 1.12.0 ext-event · HTTP library | 40,998 | 12,543 |
| AMP HTTP Server 3.4.8 Revolt · ext-event · HTTP library | 14,001 | 4,166 |
| Symfony 8.1.11 FrankenPHP | 6,114 | 3,540 |
| Spiral 3.18.2 RoadRunner | 3,125 | 2,517 |
| Laravel 13.40.0 Octane · FrankenPHP | 2,179 | 1,589 |
| Tempest 3.21.0 FrankenPHP | 991 | 904 |
ReactPHP and AMP are HTTP libraries, not full application frameworks. Each uses a router, explicit input validation and its native async MySQL driver.
Intel Core i5-9400F · 2 CPU / 2 GiB RAM limit per app (shared host). Frameworks tested 2026-11-10; ReactPHP and AMP tested separately 2026-11-11. Separate runs, not a simultaneous comparison. Framework results · ReactPHP / AMP results · Run it yourself
One command starts the application
HTTP, queue workers, and the scheduler start together. No Supervisor config, no systemd unit per worker, no crontab line. List the queue and the scheduler in app.php, then start.
$ php cua start --daemon
Starting my-app server on http://127.0.0.1:8080
Server Workers Runs
http 2 http://127.0.0.1:8080
queue 3 queue:work: mail x1, default x2
schedule 1 schedule:work
- --daemon
- Runs in the background and returns once it is up. A worker that dies is started again.
- reload
- HTTP, the queue, and the scheduler get the new code together, without refusing a connection.
- status
- Every worker, what it has handled, and its memory, in one table.
Included
- Routing typed parameters and groups
- Actions classes that say what they need
- Validation input checked before your action
- Database SQLite and MySQL, async when needed
- Queues durable work outside a request
- AI applications streaming, runs, and actors
- Testing requests without a server
- Deployment a server you can operate
A route is just a route
// routes/web.php
use Crab\Route;
Route::get('/hello/{name}', static function (string $name): array {
return ['hello' => $name];
});
Written for agents too
Explicit types, no hidden state, one way to do each thing. The same things that make code easy for a person to read make it easy for a coding agent to get right.
$ php cua describe routes
routes
POST /orders -> App\Actions\PlaceOrder via Crab\Auth\TokenAuth
body { lines: Array<{ productId: int; quantity?: int | null (minimum=1, maximum=20, default=1) }> (minItems=1, maxItems=20) }
user: App\User
GET /products/{id} -> App\Actions\ShowProduct
{id}: int
- describe
- The whole application in one read: routes and what each takes, middleware, commands, schedule, listeners, databases, settings. One thing per line, in few tokens.
--jsongives JSON Schema. - AGENTS.md
- Every new app ships with one: where things go, the rules a long-lived server needs, and how to check the work.
- Preflight
describe applists settings that do not fit and services that cannot be made, beforestartrefuses them.- Markdown
- The guide is plain Markdown, in
vendor/crabphp/framework/docs/and at /llms.txt.