Repository navigation
Releases
v1.14.0
FrankenPHP 1.14.0 makes PHP 8.6 the default. The Docker images tagged latest, the static binaries and the Windows builds now ship PHP 8.6. The php_server directive also gains a configurable file server, which makes serving pre-compressed assets a one-liner.
π PHP 8.6 by Default
- Docker: images are now built for PHP 8.6, and the
latestand version-only tags (such as1.14or1) point to it. Images for older PHP versions stay available with theirphp8.xtags (such asdunglas/frankenphp:1.14-php8.5) by @dunglas in #2862. - Static binaries: built with PHP 8.6. A few extensions don't have a release supporting PHP 8.6 yet (amqp, apcu, igbinary, imagick, lz4, memcached, msgpack, redis, xlswriterβ¦), so they are built from their development branches or from pull requests adding support by @dunglas in #2861.
- Windows: builds now use the PHP 8.6 binaries compiled with Visual Studio 2026 by @dunglas in #2860.
β οΈ Upgrade Notes
- Like the official PHP images, the PHP 8.6 Docker images no longer include
mbstringnor PECL. Install the extensions you need withinstall-php-extensions. To stay on PHP 8.5, use thephp8.5tags, such asdunglas/frankenphp:php8.5.
β¨ New Features
-
php_server: thefile_serversubdirective now accepts a block with anyfile_serveroption, exceptroot, which stays onphp_server. For instance, serving pre-compressed assets no longer requires reordering directives or adding ahandleblock by @dunglas in #2856:php_server { file_server { precompressed zstd br gzip } }
π Sponsor the Maintainers
Supporting a new PHP version on day one means patching and testing dozens of extensions, Docker images and binaries for every platform. Thanks to our sponsors for making this work possible!
If you or your company rely on FrankenPHP, please consider sponsoring its maintainers:
Need help moving to PHP 8.6? Les-Tilleuls.coop, the company behind FrankenPHP, provides professional support, performance audits, custom development and training: contact@les-tilleuls.coop.
Full Changelog: v1.13.6...v1.14.0
v1.13.6
FrankenPHP 1.13.6 is a bug fix release. It stops PHP system calls such as stream_select() from failing intermittently because of Go's preemption signal, and fixes a crash when workers are restarted during a configuration reload. Its static binaries, Windows binaries and Docker images also ship the PHP security releases published today, which fix vulnerabilities affecting all supported PHP versions, the most severe rated critical by the PHP project. Upgrading is strongly recommended.
π PHP Security Releases
- Static binaries, Windows binaries and Docker images now embed PHP 8.5.13. Docker images for older branches embed PHP 8.4.28, 8.3.37 and 8.2.36. See the PHP announcement for details. If you compile FrankenPHP yourself or install it from a package repository, update PHP as well.
π Bug Fixes
- Keep Go's
SIGURGpreemption signal off PHP threads: system calls made by PHP, such asstream_select()orIo\Poll\Context::wait(), no longer fail intermittently withEINTRby @nicolas-grekas in #2833. - Worker mode: Ignore worker restarts requested while FrankenPHP starts or stops. A
POST /frankenphp/workers/restarton the admin API during a configuration reload crashed the process by @nicolas-grekas in #2832. - Exit with status 2 when a PHP thread segfaults while FrankenPHP runs as PID 1, as in containers, instead of hanging by @cyppe in #2595.
- Windows: Log PHP errors at the right level. Fatal errors were logged as
warnand warnings asinfoby @lazerg in #2839. - Static builds: Link libstdc++ statically in the GNU binaries again. Their daily rebuilds had failed since November 9, and the binary would have required a newer libstdc++ than most hosts ship by @dunglas in #2848.
- Extensions: Compile extensions generated by
frankenphp extension-initwith GCC 14 and later by @nicolas-grekas in #2834. - Docker: Build images from the PHP 8.6 base images, which no longer have a
ztsvariant, ahead of PHP 8.6 images by @dunglas in #2859. - Build against PHP 8.7 (php-src master) by @dunglas in #2816.
- Build against non-ZTS PHP by @dunglas in #2819.
β‘ Performance Improvements
- Pass the original request URI as a string instead of copying the whole request: 1.2% fewer userland instructions per request by @henderkes in #2813.
- Skip an unused replacer lookup by @henderkes in #2820.
- Keep the request option slice on the stack by @henderkes in #2821.
π Documentation
- Warn that
max_execution_timecounts wall time, while PHP-FPM on Linux counts CPU time by @nicolas-grekas in #2846. - Explain the daily rebuilds of release binaries, how to verify them and how to pin a version by @dunglas in #2784.
putenv()writes persist across requests handled by the same worker thread by @dunglas in #2783.str_shuffle()also continues the seeded PRNG sequence in worker mode by @sucloudflare in #2825.- Worker threads come on top of
num_threadsby @nicolas-grekas in #2787. - Fix the pre-compressed assets example of the Symfony page by @dunglas in #2855.
- Add the French Symfony page and sync the French worker docs by @KevinMartinsDev in #2693.
- Link the Yii3 page from the documentation menu by @vjik in #2652.
- Update translations in #2807, #2854, #2857 and #2858.
π Sponsor the Maintainers
Shipping an upstream PHP security fix the same day means tracking the PHP, Docker and Windows releases, then rebuilding and checking dozens of images and binaries, on top of the steady flow of AI-found vulnerability reports we triage. Thank you to our sponsors, who make this work possible!
If you or your company rely on FrankenPHP, please consider sponsoring its maintainers:
π New Contributors
- @xingyaner made their first contribution in #2823
- @sucloudflare made their first contribution in #2825
- @lazerg made their first contribution in #2839
- @vjik made their first contribution in #2652
- @KevinMartinsDev made their first contribution in #2693
- @cyppe made their first contribution in #2595
Full Changelog: v1.13.5...v1.13.6
v1.13.5
FrankenPHP 1.13.5 is a security release. It fixes 17 vulnerabilities in FrankenPHP. The most severe let php_server run an uploaded non-PHP file as PHP. Several others affect the default php_server configuration: an open redirect, an HTTP/2 Host spoofing issue, a crash a client can trigger with the official Docker images' PHP settings, and slow request bodies that block every PHP thread. This release also upgrades to Caddy 2.11.9, which brings security fixes in Caddy itself, and to Mercure 1.1.6. Upgrading is strongly recommended.
π Security
- High,
php_server: A file whose name doesn't end in asplitextension could be run as PHP, for instance/uploads/photos.php.php/avatar.jpg. An attacker able to upload a file under the document root could execute it (GHSA-j99q-3wr8-xj43). - Medium,
php_server: The trailing-slash redirect for directories echoed the raw request path, so//attacker.example/..%2fblogredirected to another host. The redirect is now relative, like Caddy'sphp_fastcgi(GHSA-jvmv-5538-pqpg). - Medium, HTTP/2: A
hostheader field sent next to:authorityset$_SERVER['HTTP_HOST']to a host other than the one Caddy routed and access-checked the request on (GHSA-2725-rh2w-9j9w). - Medium,
request_body_timeout: The timeout didn't stop slow request bodies, so an unauthenticated client could block every PHP thread with one slow connection per thread. Fixed by Caddy 2.11.8 and later (GHSA-j45x-h238-h4xx). - Medium, crash: A PHP request startup failing repeatedly on a regular thread, for instance with more parameters than
max_input_varsand PHP's default settings, crashed the process with a segmentation fault (GHSA-5359-vg53-5464). - Medium, crash:
exit()ordie()with a negative status, such asdie(-1), made FrankenPHP panic and stop (GHSA-q6vv-3p75-53wr). - Medium, Caddy rules bypass: Dot segments and encoded slashes after a PHP script, such as
/admin/tool.php/../../missing.php, let requests run a script that a Caddypathrule was meant to deny (GHSA-2x4j-r638-wxff). On Windows, the same check now also covers backslashes by @dunglas in #2810. - Medium,
env: A client'sAuthorization: Basicheader replaced theREMOTE_USERvalue set withenv, and four other variables also overrodeenvvalues. Only 1.12.0 and later are affected (GHSA-388m-835f-7723). - Medium, named routes: A
php_serverorphpdirective in a Caddy named route could run with the root,envvalues and workers of another site. Only 1.13.0 and later are affected (GHSA-g7pw-whv8-97j7). - Medium, source disclosure: A
php_serverwith a workermatchrule could serve the source of scripts using an extrasplitextension, or of any script behind some rewrites (GHSA-v7hf-4gqv-hf8p). - Medium, worker mode: Destructors of objects from a previous request, including session objects, ran while the next client's output was active, sending output and cookies to the wrong client (GHSA-8qcf-v46r-g2mc).
- Medium, embedded apps: The extracted app directory was deleted on configuration reloads while the server kept serving from it, so another local user could recreate it with their own code. Incomplete fix of GHSA-6q3j-62j9-f9hh, only 1.13.2 and later are affected (GHSA-j2f3-wxf2-8qgv).
- Low, Caddyfile disclosure: With the minimal documented layout,
php_serverserved the Caddyfile stored in the document root (GHSA-xh92-4p94-ch7x). - Low, autoscaling: FrankenPHP panicked when the operating system refused to create a new PHP thread (GHSA-hfxc-999w-mp67).
- Low,
PATH_INFO: Functions such asgetlastmod()and session cache limiters let clients probe the existence and modification time of files under the document root (GHSA-g9v4-rp77-rv76). - Low, extension workers:
Workers.SendRequest()ran arbitrary files below the working directory when its worker wasn't running (GHSA-cp2q-fc46-38f5), andWorkers.SendMessage()freed azvalowned by the caller (GHSA-28vm-87fh-3px5). Only custom builds linking a Go extension that uses these experimental APIs are affected.
Most of these vulnerabilities were found by Anthropic's OSS Scanner.
β οΈ Breaking Change
- Worker mode: Between requests, FrankenPHP now only resets state built from the HTTP request: superglobals (except
$_ENV), the request body, response headers and output, the session and the URL rewriter.strtok(),http_get_last_response_headers(),error_get_last()and the libxml errors persist again, like userland state does. Callerror_clear_last(),libxml_clear_errors()orhttp_clear_last_response_headers()if you need a clean state by @dunglas in #2790.
β¨ New Features
- Populate
$_SERVER['SERVER_ADDR']with the IP address that accepted the connection, like Caddy's FastCGI transport, nginx and Apache by @dunglas in #2809.
π Bug Fixes
- Return
413when the request body exceeds Caddy'srequest_body max_sizeinstead of passing a truncated body to PHP by @dunglas in #2785. - Return
404 No input file specified.when the script can't be opened, like php-fpm, instead of a200with a fatal error by @dunglas in #2791. - Destroy persistent resources, such as
PDO::ATTR_PERSISTENTconnections, when a PHP thread exits. With PHP 8.4 and later, each worker restart leaked them, until the database refused new connections by @andreasisaak in #2812. - Extensions: Custom Go extensions stay registered after PHP restarts (file watcher,
RestartWorkers(), config reloads) by @aguinaldotupy in #2788. - Extension workers:
SendRequest()reaches workers declared without a name, andSendMessage()returnsErrNotRunningafter shutdown instead of waiting forever by @nicolas-grekas in #2786. - Worker mode: Warnings raised while parsing the request no longer reach the previous request's error handler and can be read with
error_get_last(), as with FPM by @AlliBalliBaba in #2792. - Fix a memory leak reported by OSS-Fuzz in the cached HTTP method strings by @dunglas in #2789.
- Upgrade to Caddy 2.11.9, Mercure 1.1.6 and Vulcain 1.4.6.
php_serverkeeps returning Caddy's 404 for unknown paths in sites without anindex.phpby @dunglas in #2814.
β‘ Performance Improvements
- Avoid copying already rooted request paths when computing
SCRIPT_FILENAMEby @andreybolonin in #2794. - Convert uncommon header names in one pass and one allocation by @andreybolonin in #2795.
- Use a byte search to split response headers by @andreybolonin in #2796.
π Documentation
- Select a single platform in the local static build commands by @opctim in #2805.
- Update translations in #2808.
π Sponsor the Maintainers
The "vulnapocalypse" caused by AI adds a lot of work for us: AI-powered scanners now report vulnerabilities faster than ever, and every report has to be reproduced, fixed and disclosed by a maintainer. This release alone fixes 17 advisories. Thank you to our sponsors, who make this work possible!
If you or your company rely on FrankenPHP, please consider sponsoring its maintainers:
π New Contributors
- @aguinaldotupy made their first contribution in #2788
- @andreasisaak made their first contribution in #2812
...
v1.13.4
FrankenPHP 1.13.4 is a security release. It fixes 7 vulnerabilities in FrankenPHP, including a high-severity one that let a single unauthenticated request crash the whole process in worker mode, and several cross-request leaks and memory safety issues in worker mode. Docker images and Windows builds now ship a Brotli library patched against CVE-2026-111497 (Node2Shell), and Windows and macOS binaries are now built with Go 1.27.3, which fixes vulnerabilities in the Go standard library. Upgrading is strongly recommended.
π Security
- High, worker mode: A client that sent a header name FrankenPHP hadn't seen recently and reset the connection before the request was handled crashed the whole process. Only 1.13.2 and 1.13.3 are affected (GHSA-5f4m-ff4w-g458).
- Use-after-free: A
putenv()call from a shutdown function, a destructor or a session handler left a dangling pointer, and the next script on the thread crashed the process or read the previous request's value on its firstgetenv()(GHSA-rgpj-f2qx-xwhf). - Use-after-free, worker mode: An
SplTempFileObject(orSplFileObjectonphp://temp) kept across requests, on purpose or in uncollected garbage, had its stream freed at the start of the next request (GHSA-cm3q-jw2q-9rh5). - Worker mode: Per-request environment variables (Caddy
envwith request placeholders, route-specificenvblocks,WithRequestEnv()) leaked into later requests throughgetenv()and$_SERVER.$_ENVnow only contains the worker's environment (GHSA-8386-64gm-3m8q). - Worker mode:
http_get_last_response_headers()no longer returns the upstream response headers fetched by a previous request (GHSA-pmvg-8483-mw84). As hardening, thestrtok()state and the URL rewriter variables are also reset between requests, as PHP does at the end of a script, although PHP doesn't document them as request-scoped. - Worker mode: A worker script ending its own loop right after a JSON or other non-form
POSTfreed the same pointer twice. It only had a visible effect withUSE_ZEND_ALLOC=0(GHSA-h764-4wh7-m7j2). - Worker mode: A fatal error during worker request startup left the dequeued request waiting forever (GHSA-x6j6-qv7w-fq3c).
- Brotli, CVE-2026-111497 (Node2Shell): Docker images ship a patched Brotli: the distribution's security update on Debian Trixie and Alpine, and Brotli 1.2.1 built from source on Debian Bookworm. Windows builds ship Brotli 1.2.1, including the library used by PHP's curl extension. Static binaries have bundled Brotli 1.2.1 since 1.13.2 (GHSA-p746-jj3f-94p8) by @dunglas in #2767, #2777 and #2782.
- Go: Windows and macOS binaries were built with Go 1.27.0, which is affected by several standard library vulnerabilities, including an HTTP/2 server crash (GO-2026-6617). All release binaries are now built with the latest Go patch release, 1.27.3 by @dunglas in #2776.
Apart from the header crash, which was introduced in 1.13.2 by a change in a dependency, none of the FrankenPHP vulnerabilities fixed in this release were exploitable in common setups, including Symfony and Laravel apps. Triggering them requires specific application code, such as calling putenv() from a shutdown function, or advanced, non-default configuration, such as using request-specific Caddy placeholders in env directives.
FrankenPHP has also been selected for Anthropic's OSS Scanner program, which regularly scans the project for vulnerabilities (anthropics/oss-scanner#1067).
π Bug Fixes
- Embed:
php-clinow runs extension-less scripts of the embedded app, so./my-app php-cli bin/consoleworks as documented by @dunglas in #2765. - Static builds: Release builds now push the
static-builder-{musl,gnu}-{version}image tags, which 1.13.3 didn't by @strikerz5 in #2758. - PHP 8.6: Restore compatibility with the development branch by @henderkes in #2770.
- Upgrade to Mercure 1.1.5 by @dunglas in #2768.
β‘ Performance Improvements
- Worker mode: Avoid an allocation per request when deriving
SCRIPT_NAMEfor explicitly assigned workers by @andreybolonin in #2755. - Worker mode: Avoid buffering output written while a worker starts by @andreybolonin in #2756.
π Documentation
- Document
umask()andsetlocale()as process-wide state that persists across worker requests and affects concurrent requests by @dunglas in #2779. - Update translations in #2769 and #2780.
π New Contributors
- @andreybolonin made their first contribution in #2755
- @strikerz5 made their first contribution in #2758
- @opctim made their first contribution in #2729
Full Changelog: v1.13.3...v1.13.4
v1.13.3
FrankenPHP 1.13.3 is a bug fix release. It fixes worker lookup for symlinked document roots, crashes caused by PHP extensions that install asynchronous signal handlers, and SIGILL crashes of musl static binaries on CPUs without SHA-NI.
π Bug Fixes
- Worker mode: Workers are now matched when
resolve_root_symlink falseis set and the document root is a symlink. Since 1.13.0, requests ran on a regular thread and failed with "FrankenPHP must be in worker mode". Workers are now also indexed under their declared path by @dunglas in #2739. - Extensions:
SA_ONSTACKis now re-applied to the signal handlers that extensions install at startup, for every signal and not onlySIGSEGV,SIGBUSandSIGFPE. Asynchronous handlers without the flag, such as theSIGVTALRMhandler of dd-trace-php, overflowed the goroutine stack and crashed the Go runtime later during garbage collection by @mstegmeyer in #2746. - Static builds: musl binaries are now built for the baseline CPU of the architecture instead of the build host's CPU. Release binaries used SHA-NI and AVX-512 without runtime checks, so
hash('sha256')died withSIGILLon CPUs without SHA-NI. SetSPC_TARGET=native-native-muslto opt back into host-tuned builds by @dunglas in #2749.
π Documentation
- Update translations by @github-actions[bot] in #2733, #2742 and #2750, and fix their Markdown lint errors by @dunglas in #2752.
π New Contributors
- @mstegmeyer made their first contribution in #2746
Full Changelog: v1.13.2...v1.13.3
v1.13.2
FrankenPHP 1.13.2 is a security release. Its Docker images and static binaries are built with the PHP versions that fix PHP2Shell (CVE-2026-109618 and CVE-2026-109619), two critical vulnerabilities allowing unauthenticated remote code execution. It also fixes 4 vulnerabilities in FrankenPHP itself, including a high-severity one that let a local user get their PHP code executed by a service running an embedded app. It also makes frankenphp_log() available in php-cli, stops hot reload from serving stale pages, and moves static builds to static-php-cli v3. Static builds have a few changes worth reading in the upgrade notes below. Upgrading is strongly recommended.
π Security
- Critical, PHP2Shell: Docker images are built with PHP 8.2.35, 8.3.36, 8.4.27 and 8.5.12, and static binaries with PHP 8.5.12. These versions fix CVE-2026-109618 and CVE-2026-109619, which allow unauthenticated remote code execution and have no complete mitigation besides upgrading (PHP security advisory).
- High: Embedded apps were extracted to a predictable directory in the shared temp dir, and existing files were reused. A local user could precreate that directory and get their PHP code executed by the service. Apps are now extracted atomically to a per-user directory, which is only reused when the current user owns it (GHSA-6q3j-62j9-f9hh).
- Requests waiting for a PHP thread are now dropped when their client disconnects. Before this fix, an unauthenticated client could queue requests, disconnect and keep the thread pool busy for everyone else (GHSA-fq24-r53r-xcx3).
- Cyclic arrays are now rejected when PHP values are converted to Go. A self-referencing array passed to
frankenphp_log(), returned by a worker callback or given to the extension API overflowed the stack and crashed the whole process (GHSA-ccgp-ch9h-533f). - Worker mode: The errors returned by
error_get_last()andlibxml_get_errors()are now cleared at the end of each request. Before this fix, they could leak fragments of a previous client's input and server paths into the next request served by the same thread (GHSA-4gfw-9v29-gp9h).
β οΈ Upgrade Notes
Static builds now use static-php-cli v3 by @henderkes in #2618:
- macOS: Binaries are only published for Apple Silicon. There is no
frankenphp-mac-x86_64asset anymore. On Intel Macs, build from source withbuild-static.sh. - glibc builds: The
-gnubinary now requires glibc 2.28 or later, instead of 2.17. - Static builder images: Run them with
docker runand passPHP_EXTENSIONS,PHP_EXTENSION_LIBS,XCADDY_ARGSand the other options as environment variables instead of Docker build args. The binary is written to the mounted/outputdirectory, and the defaults now live incraft.yml. See the static build docs.
β¨ New Features
- CLI:
frankenphp_log()and theFRANKENPHP_LOG_LEVEL_*constants are now available inphp-cli, so code shared between web requests and commands can log the same way. Entries use the server's format and are written to stderr. TheCaddyfileisn't loaded, so itslogdirectives don't apply by @dunglas in #2719. - Extensions:
frankenphp_thread_index()is exported again for C extensions such as frankenstate and frankenasync by @nickchomey in #2717.
π Bug Fixes
- Hot reload:
opcache.revalidate_freqnow defaults to0whenhot_reloadis configured. With the default of2, the page fetched right after a change often came back unchanged. A value set inphp.ini, inPHP_INI_SCAN_DIRor with thephp_inidirective still takes precedence by @dunglas in #2680. - Caddy: Thread and request counts are now parsed as
int. On 32-bit platforms (linux/386,linux/arm/v6andlinux/arm/v7), out-of-range values wrapped to negative numbers, somax_threads 4294967295meantauto. They now return a range error by @dunglas in #2722. - Static builds:
types.his renamed tofrankenphp_types.h, because libwebp's header with the same name shadowed it and broke the build by @alexandre-daubois in #2728.
π Documentation
- Explain how to publish Mercure updates from
php-clithrough the hub's POST endpoint, and why detectingmercure_publish()while warming caches disables it in the web server too by @dunglas in #2718. - Fix the Russian translation by @chubakur in #2712.
π New Contributors
- @chubakur made their first contribution in #2712
- @zaccesss made their first contribution in #2726
- @nickchomey made their first contribution in #2717
- @sergehardy made their first contribution in #1926
Full Changelog: v1.13.1...v1.13.2
v1.13.1
FrankenPHP 1.13.1 fixes the regressions reported since 1.13.0. Nextcloud and other apps that read $_SERVER['REQUEST_URI'] while booting can run in worker mode again, php-cli exposes $argv like the native CLI again (fixing Symfony Console), and Caddy workers retry failed boots as documented instead of giving up on the first error. It also fixes two process crashes and 500 errors during graceful shutdown. Static builds now include the deepclone extension, which speeds up Symfony's cache. Upgrading is recommended for all 1.13.0 users.
β¨ New Features
- Static builds: Add deepclone to the default extensions. It is the native implementation of Symfony's
DeepCloner, used byVarExporter::export()(and so thecache.systemfiles) andArrayAdaptersince symfony/var-exporter 8.1, and is several times faster than the PHP polyfill on large object graphs by @soyuka in #2699.
π Bug Fixes
- Workers: Set
$_SERVER['REQUEST_URI']to the script name while booting workers, as in 1.12.7. Nextcloud redirected and exited during boot, so its worker failed with "too many consecutive failures" by @dunglas in #2701. Fixes #2697. - Workers:
max_consecutive_failuresnow defaults to 6 for workers declared in a Caddyfile or JSON config, as documented. Previously, any boot failure aborted startup without retrying. An explicit0still disables retries by @dunglas in #2704. - CLI:
php-clisets$argv[0]to the script path (orStandard input codewith-r) like the native CLI SAPI, instead of the binary name followed by a shifted script path. This broke Symfony Console and other tools reading$argvby @henderkes in #2691. Fixes #2690. - Graceful shutdown: Keep PHP running until Caddy has stopped all apps, so requests served during
shutdown_delayand in-flight requests no longer get HTTP 500 errors by @nesl247 in #2645. Fixes #2644. - Threads: Fix a segfault of the whole process when restarting an unhealthy thread, a regression since 1.12.4 by @BastienClement in #2696. Fixes #2688.
- Request body: Don't read the request body after the request has finished. With
fastcgi_finish_request()orfrankenphp_finish_request()over HTTP/2, PHP's shutdown drained the body after the handler returned, which could crash the process by @dunglas in #2702. Fixes #2694. - Forked processes: Only tie direct children of FrankenPHP to its lifetime, so processes that double-fork no longer kill their grandchildren. This broke the gnupg extension ("could not init keylist"), a regression since 1.12.5 by @dunglas in #2703. Fixes #2689.
- Mercure: Exclude the hub from
encodein the sampleCaddyfileand document the pattern. Since Caddy 2.11.7 compresses server-sent events, each subscriber held a compression encoder (a few MiB with zstd), and compressing private updates next to attacker-influenced data enables BREACH-style attacks.php-server --mercureisn't affected by @dunglas in #2692.
π New Contributors
- @nesl247 made their first contribution in #2645
- @BastienClement made their first contribution in #2696
Full Changelog: v1.13.0...v1.13.1
v1.13.0
FrankenPHP 1.13.0 is a big one. It upgrades to Caddy 2.11.7, bringing Slowloris protection, the new url_pattern matcher, the Incremental header for streaming apps and many reverse proxy fixes. It ships with Mercure 1.0, the stable version of the real-time protocol. Configuration reloads are now safe: an invalid configuration is rejected before it replaces the running one, instead of leaving the server answering 500. This release also fixes 5 security vulnerabilities, 2 of them rated high. Upgrading is strongly recommended, and the upgrade notes below are worth a read first. Need help with the upgrade or with sizing threads and workers? Les-Tilleuls.coop, the company behind FrankenPHP, provides professional support, performance audits, custom development and training: contact@les-tilleuls.coop.
π Security
- High: Fix a document-root escape in
SCRIPT_FILENAMEresolution on Windows (GHSA-868c-7h7m-mmj9). - High: Fix header spoofing through dot-form header names: PHP maps
Foo.BartoHTTP_FOO_BARlikeFoo-Bar. Caddy 2.11.7 now drops such headers by default, and theNewRequestWithContext()documentation warns library users (GHSA-qcrp-8483-f2f2). - Require a path segment boundary when splitting the CGI path, so
/uploads/a.php.txt/b.phpno longer executesuploads/a.php(GHSA-xxjp-cjxr-2x6m). putenv()no longer writes to the process-wide OS environment, which leaked values across requests and threads (GHSA-996f-w38m-f574).- Fix a crash of the whole server process when
frankenphp_log()receives a crafted array (GHSA-4prg-hv4r-g6mv).
π Caddy 2.11.7
FrankenPHP 1.12.7 shipped Caddy 2.11.4. This release includes everything from Caddy 2.11.6 and 2.11.7, including:
- Slowloris protection: idle read/write timeouts reset on every successful read or write, so stalled connections are cut off while slow but progressing ones are left alone. Tune them per route with the new
timeoutsdirective by @dunglas in caddy#7913. url_patternmatcher: match requests with the URLPattern web standard (named groups, wildcards, regexps), the same syntax used by browsers and many frameworks. Captured groups become placeholders by @dunglas in caddy#7787.Incrementalheader (RFC 10036): the standard replacement for NGINX'sX-Accel-Buffering. Responses withIncremental: ?1are streamed immediately byreverse_proxyandencodeby @dunglas in caddy#8020.- Server-sent events behind
encodenow stream immediately instead of being buffered, which benefits Mercure by @SillyZir in caddy#7905. - Graceful shutdown waits for servers left over from previous configurations, so long-lived responses that started before a reload aren't cut off by @dunglas in caddy#8009.
tls_automate_namesglobal option to manage certificates for names not served by a site block by @IslamElsayed in caddy#8015.- Faster TLS handshakes: certificate lookup is about twice as fast, with 10 allocations instead of 15 by @u5surf in caddy#8010.
- Reverse proxy: partial responses are flushed properly by @WeidiDeng in caddy#7849, TCP half-close is propagated on upgraded streams by @btncwn in caddy#8027, and active health checks are isolated per check config by @SillyZir in caddy#7916.
expected_underscore_headers(by @bluegate-studio in caddy#7809) andexpected_dot_headerskeep specific headers that Caddy now drops.
π‘ Mercure 1.0
FrankenPHP embeds Mercure 1.0 by @dunglas in #2611:
mercure_publish()now throws aValueErrorfor invalid updates (topic in the reserved/.well-known/mercurenamespace, ID starting with#, control characters, invalid UTF-8, negativeretry, no topic) and aRuntimeExceptioncarrying the hub's message when the dispatch fails.- Publisher and subscriber keys are bound to a trusted issuer with the new
issuerblock. The sampleCaddyfileandphp-server --mercureuse it.
β οΈ Upgrade Notes
num_threadsnow counts the threads for requests no worker serves; worker threads come on top. A configuration that setsnum_threadswith workers declared starts more threads than before. Ifmax_threadsis belownum_threadsplus the worker threads, startup now fails with an error naming the three numbers. Defaults are unchanged (#2660).- Mercure: setting
publisher_jwtorsubscriber_jwtwithoutprotocol_version_compatibilityis now a configuration error. Bind keys to a trusted issuer with the newissuerblock instead (see #2611 and the sampleCaddyfile). Hot reloading follows the protocol:$_SERVER['FRANKENPHP_HOT_RELOAD']now advertises/.well-known/mercure?match=<topic>, so update any URL hardcoded with?topic=. - Caddy: request headers are now limited to 16 KiB by default (raise it with
max_header_size), stalled reads and writes are aborted after 1 minute, headers containing.are dropped like those containing_already were, a wildcard site'sclient_authno longer applies to more specific sites, and some invalid configurations are now rejected. See the Caddy 2.11.6 breaking changes. - Building PHP without
--disable-zend-signals(ZTS) now makes FrankenPHP refuse to start with an explicit error, instead of hanging while memory grows (#2639).
β¨ New Features
- Extensions: Expose a thread API for Go-based PHP extensions:
Thread(index)to get the request bound to a PHP thread,PHPThread.Pin()to keep Go objects alive,PHPThread.IsRequestDone(), and thefrankenphp_thread_index()C function by @johanjanssens in #2305. - Config reloads: Validate a configuration before it replaces the running one. A missing worker file, a duplicated worker name or an inconsistent thread budget is now rejected and the running configuration keeps serving. Library users get
frankenphp.Validate()by @nicolas-grekas in #2661. - Threads:
num_threadscounts the threads left for regular requests, and the startup log reportstotal_threadsandworker_threadsby @nicolas-grekas in #2660. - Opcache: Log opcache shared-memory restarts and count them in the new experimental
frankenphp_opcache_restarts{reason}metric (PHP 8.4+). These restarts are unsafe under ZTS, so the counter should stay at zero by @nicolas-grekas in #2634. php_server: Mirrorphp_serverblocks on the FrankenPHP side, so requests and workers are properly scoped to their block by @AlliBalliBaba in #2499.- phpinfo:
phpinfo()now has a FrankenPHP section listing the Caddy version, and Go code can add rows withfrankenphp.AddPHPInfoEntry()by @henderkes in #2578. - CLI:
php-cliuses PHP's built-in CLI SAPI on PHP 8.5+ by @withinboredom in #1757. - PHP 8.6: Compatibility with PHP 8.6 by @henderkes in #2600.
- Upgrade to Go 1.27 by @alexandre-daubois in #2626.
π Bug Fixes
- Startup: Don't hang requests that arrive before regular threads are ready, which showed up as random 499/504 errors on the first requests after a container start by @ptondereau in #2612.
- Workers: Log worker crashes at
warnlevel with their exit status, instead ofdebuglike a clean restart by @luminalpark in #2602. - Shutdown: Fix
Shutdown()hanging forever on a worker that gave up during boot pastmax_consecutive_failuresby @nicolas-grekas in #2662 and #2664. - Static builds: Stop the bundled
parallelextension from turni...
v1.12.7
FrankenPHP 1.12.7 fixes a bug where output written after fastcgi_finish_request()/frankenphp_finish_request() was silently discarded in classic (non-worker) mode: with the default ignore_user_abort, echoing anything after finishing the request incorrectly marked the connection as aborted and bailed out mid-script. It also quiets noisy debug-level logging for routine client disconnects and fixes an incorrect thread-count metric.
π Bug Fixes
- Classic mode: Fix output written after
fastcgi_finish_request()/frankenphp_finish_request()being silently discarded. With the defaultignore_user_abort, echoing anything after finishing the request incorrectly marked the connection as aborted and bailed out mid-script by @dunglas in #2569. Fixes #2548. - Metrics: Report
frankenphp_total_threadsas a gauge instead of accumulating it, so the metric reflects the current thread count instead of growing unbounded by @ousamabenyounes in #2550. Fixes #2481. - Opcache: Remove the opcache-invalidation restart hook again; restarting on every opcache reset could cascade into recursive restarts for frameworks that invalidate the cache heavily by @AlliBalliBaba in #2564.
- Logging: Stop logging routine client-disconnect write/flush errors at
warnlevel; they're nowdebug, matching Caddy and Mercure's convention, and no longer mislabeled as "not a flusher" by @dunglas in #2589. - Build: Take the
PHP_CONFIGenvironment variable into account ingo.shby @henderkes in #2557.
π Documentation
π New Contributors
- @ousamabenyounes made their first contribution in #2550
Full Changelog: v1.12.6...v1.12.7
v1.12.6
FrankenPHP 1.12.6 fixes a crash that could take down the whole process on HTTP/2. If a PHP script calls frankenphp_finish_request() (or closes its context early) and then lazily reads php://input β common with enable_post_data_reading=Off β FrankenPHP set a read deadline on an already-finalized HTTP/2 stream and segfaulted. HTTP/1 was unaffected. Anyone serving over HTTP/2 should upgrade.
π Bug Fixes
- HTTP/2: Don't set a request body read deadline after the request is finished. Reading
php://inputafterfrankenphp_finish_request()dereferenced the nil'd-out HTTP/2 stream state and crashed the process; the deadline is now skipped once the context is done by @dunglas in #2538. Fixes #2535.
π Documentation
- Add a PSR-15 worker example by @dunglas in #2539.
- Remove title case in docs by @alexandre-daubois in #2534.
- Update translations by @github-actions in #2537.
Full Changelog: v1.12.5...v1.12.6