HTTP & routing
OmniPHP\HttpTyped parameters, route groups, onion middleware, response helpers and sessions.
OPEN SOURCE · PHP 8.4+
The universal PHP framework.
The process model of a daemon. The ergonomics of a classic web framework. Build long-running APIs, real-time services and background workers with one lightweight core.
Install with Composer
composer require omniphp/framework<?php
require __DIR__ . '/vendor/autoload.php';
use OmniPHP\Application;
use OmniPHP\Http\{Context, Kernel, Router};
use OmniPHP\Http\Middlewares\ResponseMiddleware;
use Workerman\Worker;
Application::boot(__DIR__);
Application::workerman('server');
Router::group('/api', function () {
Router::get('/hello/{name}', fn (Context $ctx) => [
'hello' => $ctx->param('name'),
]);
}, [new ResponseMiddleware()]);
$http = new Worker('http://0.0.0.0:8080');
$http->count = 4;
$http->onMessage = [Kernel::class, 'handle'];
Worker::runAll();
No PHP-FPM request lifecycle. Just PHP, Workerman and your application.
01 / THE TOOLKIT
Compose your application from a focused set of modules. Use the parts you need, without adopting a heavyweight stack.
OmniPHP\HttpTyped parameters, route groups, onion middleware, response helpers and sessions.
OmniPHP\WebSocketConnection management, broadcasts, ping/pong and full-duplex messaging.
OmniPHP\DatabaseFluent queries, migrations, transactions, soft deletes and per-worker connections.
OmniPHP\QueueRedis Streams, priorities, delayed jobs, retries and dead-letter handling.
OmniPHP\RequestsFiber-aware HTTP, async MySQL and Redis on the same Revolt scheduler.
OmniPHP\ApplicationCompiled views, file and Redis cache, configuration, locale fallback and logging.
02 / THE RUNTIME
Boot once, then let your workers handle the next request. The Fiber event loop suspends I/O without blocking other work in the same worker.
Application code and configuration stay loaded across requests. Connections belong to their worker.
HTTP, MySQL and Redis integrate with the Workerman Fiber loop; no second polling loop required.
Register routes, middleware and lifecycle hooks yourself. Keep request state separate from long-lived process state.
Conceptual architecture — not a performance benchmark.
03 / BUILT FOR DEVELOPERS
Plain PHP classes and familiar APIs, whether you are building an API or a background process.
use OmniPHP\Database\DB;
$books = DB::table('books')
->select('id', 'title')
->where('published', 1)
->orderBy('id', 'DESC')
->limit(20)
->get();use OmniPHP\Queue\Producer;
// Register 'catalog.refresh' in config/queue.php handlers.
$producer = new Producer();
$producer->push('catalog.refresh', ['id' => 7]);
$producer->pushDelayed('catalog.refresh', ['id' => 8], 60);04 / START BUILDING
Install the framework or start with the ready-made project skeleton. The source is open and the docs are ready to explore.
composer create-project omniphp/omniphp myapp
cd myapp