From the browser to a web server
Choose how PHP runs.
The language is PHP. The runtime decides how requests reach your code and how long application state lives. These guides cover SAPIs, application servers, persistent workers, async libraries and runtime integrations, and say which category each one belongs to.
Lessons on this site run PHP 8.5.10 as WebAssembly in your browser. To run PHP on your own machine, start with FrankenPHP or PHP-FPM in Docker Compose →
Learn what the PHP CLI SAPI is, how it differs from web SAPIs, and how to run a stdin and exit-code script in the official PHP Docker image.
Read the guide · 12 min →PHP built-in web server for local developmentDevelopment serverLearn what the PHP CLI built-in web server is, how router scripts and document roots work, and why it is for development and controlled demos only.
Read the guide · 12 min →PHP-FPMFastCGI Process Manager for PHPLearn what PHP-FPM is, how a web server hands requests to FPM worker pools, and how to run Nginx with a PHP 8.4 FPM container while keeping FastCGI off host ports.
Read the guide · 12 min →Apache mod_phpPHP embedded in Apache httpdWhat Apache mod_php is, how its prefork-based execution model works, why the PHP manual steers new installs to PHP-FPM, and a minimal php:8.4-apache Docker Compose example.
Read the guide · 12 min →PHP CGI and FastCGIHow the CGI SAPI fits inA cautious, source-limited look at PHP's CGI build, how it differs from the CLI, and why FastCGI and FPM need separate evidence and must never be exposed publicly.
Read the guide · 12 min →FrankenPHPCaddy-based PHP application serverA guide to FrankenPHP, a Caddy-based PHP application server: classic mode first, worker mode state risks, Docker setup and deployment notes.
Read the guide · 12 min →FrankenPHP worker modePersistent PHP worker modelA guide to FrankenPHP worker mode: how the persistent worker loop differs from classic mode, what state survives between requests, and how to reset it.
Read the guide · 12 min →RoadRunnerGo application server that manages PHP workersLearn how RoadRunner, a Go-based application server and process manager, keeps PHP workers alive, and how to reason about state leakage and cleanup in persistent workers.
Read the guide · 12 min →SwooleCoroutine extension and server for PHPSwoole is a PHP extension that adds an event loop, coroutines and servers for long-lived PHP services. Learn its model, install approach, a minimal HTTP server and the risks of persistent workers.
Read the guide · 12 min →Open SwooleCoroutine extension and server for PHPA guide to Open Swoole, a C/C++ PHP extension and server that keeps PHP code resident, with a minimal loopback HTTP server and notes on state leakage.
Read the guide · 12 min →WorkermanPersistent PHP application serverLearn what Workerman is, how its long-running worker model differs from classic PHP request lifetimes, and how to avoid state leakage in a small Composer-installed HTTP worker.
Read the guide · 12 min →ReactPHPEvent loop and HTTP server guideReactPHP is an event-driven async library for PHP, not a separate interpreter. Learn its event loop model, persistent-process state risks, and a Composer-based HTTP server.
Read the guide · 12 min →AMPHPAsync libraries, fibers and a Composer HTTP serverAMPHP is a set of Composer libraries for non-blocking PHP built on fibers and Revolt. It is not a separate interpreter. This guide covers its HTTP server model and persistent-process pitfalls.
Read the guide · 12 min →PHP WebAssembly (php-wasm) in the browser and NodeBrowser/Node WebAssembly runtimeA guide to PHP compiled to WebAssembly through the WordPress Playground project: how it runs, where it fits, its limits, and a minimal browser example.
Read the guide · 12 min →Laravel OctanePersistent-worker serving for LaravelWhat Laravel Octane is, how it keeps a Laravel app in memory on FrankenPHP, Open Swoole, Swoole or RoadRunner, and why state leakage matters.
Read the guide · 12 min →Symfony RuntimeBootstrap abstraction for PHP front controllersSymfony Runtime is a Composer-based bootstrap abstraction, not an interpreter or server. It lets one front controller work with PHP-FPM, CLI and worker-style backends.
Read the guide · 12 min →BrefRunning PHP on AWS LambdaA guide to Bref, the open source Composer package and toolkit for running PHP applications serverless on AWS Lambda, with a local readiness example.
Read the guide · 12 min →NGINX UnitHistorical application server for PHPHistoricalA historical guide to NGINX Unit, an archived multi-language application server with a PHP module, and how it differs from a Nginx plus FPM pairing.
Read the guide · 12 min →HHVMHack virtual machine, not a PHP 8.4 runtimeHHVM is an open-source JIT virtual machine for the Hack language. This guide explains how it differs from PHP, why it is not a PHP 8.4 runtime, and where it fits.
Read the guide · 12 min →PHP embed SAPICalling the Zend Engine from a native hostA guide to the PHP embed SAPI in php-src (PHP-8.4 branch): what it is, how a C host starts requests, and how to build a minimal example.
Read the guide · 12 min →