Server
14 ms p99 latency
PAM is a persistent PHP runtime written in Rust. Your Composer app boots once and stays warm, requests run in Fibers on async I/O, and the same PHP ships to servers, Laravel, Android, iOS and the desktop.
curl -fsSL https://pamphp.com/install | sh<?php
declare(strict_types=1);
use Pam\App;
$app = new App();
$app->get('/users/{id}', static fn ($request, $response) => $response->json([ 'id' => $request->route('id'), ]));
$app->listen(3000);pam devAn HTTP server in plain PHP. The app boots once and stays warm between requests.
<?php
use App\Models\User;use Illuminate\Support\Facades\Route;
Route::get('/users/{user}', fn (User $user) => $user);
// pam artisan migrate · pam artisan queue:work// pam start pam.php --workers "$(nproc)"pam dev pam.phpYour Laravel app, unchanged, served by persistent PAM workers instead of PHP-FPM.
<?phpfinal class Counter extends Component{ #[State] public int $count = 0;
#[\Pam\Native\Attributes\Action] public function increment(): void { $this->count++; }}?>
<template language="2"> <Column class="card"> <Text class="title">Count: {{ $count }}</Text> <Button label="Increment" @press="increment" /> </Column></template>pam mobile devReal Android and iOS views from a PHP component. No WebView, no JavaScript bridge.
<?php
require __DIR__.'/vendor/autoload.php';
use Pam\Crawl\Crawl;use Pam\Crawl\Page;
// One page -> clean Markdown for an LLM$page = Crawl::url('https://www.php.net/manual/en/')->get();echo $page->content->raw;
// A docs section, 32 requests in flightCrawl::site('https://www.php.net/manual/en/') ->only('/manual/en/*') ->depth(2)->limit(20) ->concurrency(32) ->each(function (Page $p): void { printf("%d %s\n", $p->status, $p->url); });pam crawl.phpClean Markdown for LLMs from whole sites, with HTTP/2 and bounded memory.
Why PAM
PHP-FPM throws your application away after every request. PAM keeps it alive, so the work you already paid for (autoloading, config, containers, connections) is there for the next one.
Your Composer app, framework container and OPcache stay in memory. Requests skip the bootstrap and go straight to your code.
Every request runs in its own isolated Fiber. Async I/O suspends the Fiber instead of blocking the worker.
Preforked workers share one OPcache, recycle after a request budget and are restarted by the supervisor when they crash.
Sockets, timers, TLS and HTTP/1.1, HTTP/2 and HTTP/3 run on Tokio. PHP runs through the embed SAPI, not a shim.
Serve WebSockets from the same listener as HTTP, with backpressure handled by the runtime.
pam init, pam dev, pam composer, pam artisan and pam doctor. No system PHP, no PHP-FPM, no Node.
Performance
Same app, same machine, published protocol. Against FrankenPHP and OpenSwoole, PAM won 11 of 12 throughput scenarios.
Server
14 ms p99 latency
Desktop · same POS app
11× faster launch than Electron
Crawl · 460 real pages
448 pages/s with 8 workers
Server: Laravel on the benchmark protocol. Desktop: a 37-screen point-of-sale app rewritten from Electron. Crawl: crawl4ai 0.9.6, whole process tree measured, Core Ultra 9 185H (method).
One runtime, four targets
pam init my-api --template httpRead the guide pam init my-app --template laravelRead the guide pam init my-app --template native-ui --platform allRead the guide pam init my-app --template desktopRead the guide Ecosystem
Install with pam composer require pushinbr/…. Every package is open source and published on Packagist.
Express-like routing with a Laravel-like structure: container, middleware, validation, resources.
Production tooling, lifecycle safety, observability and deployment for Laravel on PAM.
Fast native Android and iOS applications written in PHP, with a plugin ecosystem.
Native Linux, macOS and Windows applications with PHP, without Electron.
Browserless crawler and scraper: clean Markdown for LLMs, typed extraction, HTTP/2.
JavaScript rendering for pam-crawl through headless Chrome or Lightpanda over CDP.
Typed Chrome DevTools Protocol client for the PAM runtime.
Persistent WhatsApp Web client for PHP, without Node.js or Puppeteer.
Telegram Bot API framework: middleware, commands, sessions and wizard scenes.
Quick start
One binary in ~/.local/bin. It brings its own PHP and Composer.
curl -fsSL https://pamphp.com/install | shPick a template: http, laravel, native-ui or desktop.
pam init my-api --template httpThe dev server watches your code and reloads on save. pam doctor checks your setup.
cd my-api && pam devRead the guide, or go straight to the code.