The modern PHP app server
Find a file
Alexandre Daubois 33fcc4d5c0
chore: bump GA deps (#2288)
Supersedes #2286
2026-03-17 10:06:55 +01:00
.github chore: bump GA deps (#2288) 2026-03-17 10:06:55 +01:00
caddy chore: prepare release 1.12.1 2026-03-10 10:49:02 +01:00
docs docs: update translations (#2285) 2026-03-17 10:06:32 +01:00
internal refactor: hoist LoaderFunc to package-level var in phpheaders (#2053) 2026-03-10 19:07:32 +01:00
package Add restart policies to frankenphp service (#2191) 2026-02-16 14:45:49 +01:00
testdata tests: opcache_preload (#2257) 2026-03-09 15:54:36 +01:00
.clang-format-ignore feat: mercure_publish() PHP function to dispatch Mercure updates (#1927) 2025-11-18 09:59:53 +01:00
.codespellrc ci: disable codespell linter (#2153) 2026-01-29 17:23:50 +01:00
.dockerignore ci: include version in BuildInfo and Prometheus metrics (#1418) 2025-03-19 13:27:28 +01:00
.editorconfig docs: revise bug report template for improved instructions (#2181) 2026-03-09 15:55:51 +01:00
.gitattributes feat: Windows support (#2119) 2026-02-26 12:38:14 +01:00
.gitignore feat(docs): add autocompletion docs (#2010) 2026-03-16 09:38:14 +07:00
.gitleaksignore run translation even if linter failed (#2145) 2026-01-27 00:02:19 +01:00
.golangci.yaml ci: minor cleanup (#1619) 2025-05-31 08:01:38 +02:00
.hadolint.yaml ci: add Super-Linter (#323) 2023-12-01 17:26:21 +01:00
.markdown-lint.yaml chore: make super-linter green (#2051) 2025-12-01 15:52:08 +01:00
alpine.Dockerfile feat(docs): add autocompletion docs (#2010) 2026-03-16 09:38:14 +07:00
app.tar feat: use tar to embed apps (#333) 2023-12-03 19:17:36 +01:00
app_checksum.txt fix: do not extract embedded app on every execution (#488) 2024-01-21 18:13:08 +01:00
build-static.sh ci: fallback on static-php.dev mirror when php.net is down (#2233) 2026-03-05 17:50:21 +01:00
cgi.go refactor: cleaner cgi string handling 2026-03-04 17:20:24 +01:00
cgi_test.go chore: run go fmt (#2211) 2026-02-21 17:38:51 +01:00
cgo.go feat: Windows support (#2119) 2026-02-26 12:38:14 +01:00
cli.go feat: Windows support (#2119) 2026-02-26 12:38:14 +01:00
cli_test.go feat: Windows support (#2119) 2026-02-26 12:38:14 +01:00
context.go perf: various optimizations (#2175) 2026-02-11 15:21:55 +01:00
CONTRIBUTING.md Add IDE (GoLand/CLion) setup to CONTRIBUTING.md (#2269) 2026-03-12 14:51:48 +07:00
debugstate.go refactor: extract the state module and make the backoff error instead of panic 2025-12-02 23:10:12 +01:00
dev-alpine.Dockerfile chore: bump to Go 1.26 (#2178) 2026-02-11 14:55:57 +01:00
dev.Dockerfile chore: bump to Go 1.26 (#2178) 2026-02-11 14:55:57 +01:00
docker-bake.hcl chore: bump to Go 1.26 (#2178) 2026-02-11 14:55:57 +01:00
Dockerfile feat(docs): add autocompletion docs (#2010) 2026-03-16 09:38:14 +07:00
embed.go feat: allow to customize EmbeddedAppPath 2026-02-18 16:30:18 +01:00
env.go refactor: cleaner cgi string handling 2026-03-04 17:20:24 +01:00
ext.go feat: Windows support (#2119) 2026-02-26 12:38:14 +01:00
frankenphp.c fix: opcache_preload in PHP 8.2 (#2284) 2026-03-17 11:14:45 +07:00
frankenphp.go fix sigsev on bind permissions denied (#2250?) (#2251) 2026-03-09 18:32:22 +07:00
frankenphp.h refactor: cleaner cgi string handling 2026-03-04 17:20:24 +01:00
frankenphp.ico feat: Windows support (#2119) 2026-02-26 12:38:14 +01:00
frankenphp.png docs: optimize PNG images losslessly: 2 → 1.3 MiB (−36%) (#1623) 2025-06-01 21:47:08 +02:00
frankenphp.stub.php feat: add support for structured logging with the frankenphp_log() PHP function (#1979) 2025-12-15 16:10:35 +01:00
frankenphp_arginfo.h feat: add support for structured logging with the frankenphp_log() PHP function (#1979) 2025-12-15 16:10:35 +01:00
frankenphp_test.go fix: opcache_preload in PHP 8.2 (#2284) 2026-03-17 11:14:45 +07:00
go.mod chore: bump deps 2026-03-10 10:33:03 +01:00
go.sh fix(ci): Docker builds 2025-07-17 10:14:18 +02:00
go.sum chore: bump deps 2026-03-10 10:33:03 +01:00
hotreload.go feat: hot reload (#2031) 2025-12-12 14:29:18 +01:00
install.ps1 ci: fix Windows asset upload (#2245) 2026-03-07 19:44:08 +01:00
install.sh ci: fix Windows asset upload (#2245) 2026-03-07 19:44:08 +01:00
LICENSE docs: add license (#24) 2022-10-15 11:21:21 +02:00
log_test.go feat: add support for structured logging with the frankenphp_log() PHP function (#1979) 2025-12-15 16:10:35 +01:00
mercure-skip.go feat: hot reload (#2031) 2025-12-12 14:29:18 +01:00
mercure.go feat: Windows support (#2119) 2026-02-26 12:38:14 +01:00
mercure_test.go fix: crash when a string is passed for the topics parameter of the mercure_publish() function (#2021) 2025-11-23 17:03:43 +01:00
metrics.go metrics: only report workers ready when actually ready (#2210) 2026-02-21 17:34:35 +01:00
metrics_test.go feat: introduces worker name option, use label on worker metrics instead (#1376) 2025-03-22 12:32:59 +01:00
options.go feat(caddy): configurable max_idle_time for autoscaled threads (#2225) 2026-03-06 14:43:37 +01:00
phpmainthread.go refactor: cleaner cgi string handling 2026-03-04 17:20:24 +01:00
phpmainthread_test.go fix php startup errors when ini files contain environment variables (#2252) 2026-03-08 22:28:14 +07:00
phpthread.go perf: move sandboxed environment to the C side (#2058) 2026-02-26 22:34:54 +01:00
README.md docs: update README for Windows, other minor changes (#2249) 2026-03-07 19:47:51 +01:00
recorder_test.go chore: modernize Go code 2025-08-15 00:22:44 +02:00
release.sh ci: automatically create the Brew formula PR on release 2024-12-20 18:57:00 +01:00
reload_test.sh ci: upgrade to super-linter 6 (#952) 2024-08-04 14:05:54 +02:00
requestoptions.go perf: various optimizations (#2175) 2026-02-11 15:21:55 +01:00
requestoptions_test.go fix: race condition introduced in 04fdc0c (#2180) 2026-02-11 13:07:09 +01:00
scaling.go feat(caddy): configurable max_idle_time for autoscaled threads (#2225) 2026-03-06 14:43:37 +01:00
scaling_test.go feat(caddy): configurable max_idle_time for autoscaled threads (#2225) 2026-03-06 14:43:37 +01:00
SECURITY.md docs: update repository links and sync cn readme (#1711) 2025-07-01 10:29:55 +02:00
static-builder-gnu.Dockerfile ci: verbose logs for StaticPHP (#2074) 2025-12-15 20:13:15 +01:00
static-builder-musl.Dockerfile ci: verbose logs for StaticPHP (#2074) 2025-12-15 20:13:15 +01:00
threadinactive.go refactor: extract the state module and make the backoff error instead of panic 2025-12-02 23:10:12 +01:00
threadregular.go perf: move sandboxed environment to the C side (#2058) 2026-02-26 22:34:54 +01:00
threadtasks_test.go refactor: extract the state module and make the backoff error instead of panic 2025-12-02 23:10:12 +01:00
threadworker.go perf: move sandboxed environment to the C side (#2058) 2026-02-26 22:34:54 +01:00
types.c perf: move sandboxed environment to the C side (#2058) 2026-02-26 22:34:54 +01:00
types.go feat: Windows support (#2119) 2026-02-26 12:38:14 +01:00
types.h perf: move sandboxed environment to the C side (#2058) 2026-02-26 22:34:54 +01:00
types_test.go feat: add support for structured logging with the frankenphp_log() PHP function (#1979) 2025-12-15 16:10:35 +01:00
vcpkg.json feat: Windows support (#2119) 2026-02-26 12:38:14 +01:00
watcher-skip.go feat: hot reload (#2031) 2025-12-12 14:29:18 +01:00
watcher.go fix: prevent segfault on early shutdown. (#2120) 2026-01-10 21:40:54 +01:00
watcher_test.go feat: Windows support (#2119) 2026-02-26 12:38:14 +01:00
worker.go feat: Windows support (#2119) 2026-02-26 12:38:14 +01:00
worker_test.go perf: move sandboxed environment to the C side (#2058) 2026-02-26 22:34:54 +01:00
workerextension.go refactor: rely on context.Context for log/slog and others (#1969) 2025-11-17 16:32:23 +01:00
workerextension_test.go feat: hot reload (#2031) 2025-12-12 14:29:18 +01:00
zizmor.yaml ci: fix issues and lint with zizmor 2025-08-28 19:16:32 +02:00

FrankenPHP: Modern App Server for PHP

FrankenPHP

FrankenPHP is a modern application server for PHP built on top of the Caddy web server.

FrankenPHP gives superpowers to your PHP apps thanks to its stunning features: Early Hints, worker mode, real-time capabilities, hot reloading, automatic HTTPS, HTTP/2, and HTTP/3 support...

FrankenPHP works with any PHP app and makes your Laravel and Symfony projects faster than ever thanks to their official integrations with the worker mode.

FrankenPHP can also be used as a standalone Go library to embed PHP in any app using net/http.

Learn more on frankenphp.dev and in this slide deck:

Slides

Getting Started

Install Script

On Linux and macOS, copy this line into your terminal to automatically install an appropriate version for your platform:

curl https://frankenphp.dev/install.sh | sh

On Windows, run this in PowerShell:

irm https://frankenphp.dev/install.ps1 | iex

Standalone Binary

We provide FrankenPHP binaries for Linux, macOS and Windows containing PHP 8.5.

Linux binaries are statically linked, so they can be used on any Linux distribution without installing any dependency. macOS binaries are also self-contained. They contain most popular PHP extensions. Windows archives contain the official PHP binary for Windows.

Download FrankenPHP

rpm Packages

Our maintainers offer rpm packages for all systems using dnf. To install, run:

sudo dnf install https://rpm.henderkes.com/static-php-1-0.noarch.rpm
sudo dnf module enable php-zts:static-8.5 # 8.2-8.5 available
sudo dnf install frankenphp

Installing extensions: sudo dnf install php-zts-<extension>

For extensions not available by default, use PIE:

sudo dnf install pie-zts
sudo pie-zts install asgrim/example-pie-extension

deb Packages

Our maintainers offer deb packages for all systems using apt. To install, run:

VERSION=85 # 82-85 available
sudo curl https://pkg.henderkes.com/api/packages/${VERSION}/debian/repository.key -o /etc/apt/keyrings/static-php${VERSION}.asc
echo "deb [signed-by=/etc/apt/keyrings/static-php${VERSION}.asc] https://pkg.henderkes.com/api/packages/${VERSION}/debian php-zts main" | sudo tee -a /etc/apt/sources.list.d/static-php${VERSION}.list
sudo apt update
sudo apt install frankenphp

Installing extensions: sudo apt install php-zts-<extension>

For extensions not available by default, use PIE:

sudo apt install pie-zts
sudo pie-zts install asgrim/example-pie-extension

apk Packages

Our maintainers offer apk packages for all systems using apk. To install, run:

VERSION=85 # 82-85 available
echo "https://pkg.henderkes.com/api/packages/${VERSION}/alpine/main/php-zts" | sudo tee -a /etc/apk/repositories
KEYFILE=$(curl -sJOw '%{filename_effective}' https://pkg.henderkes.com/api/packages/${VERSION}/alpine/key)
sudo mv ${KEYFILE} /etc/apk/keys/ && 
sudo apk update && 
sudo apk add frankenphp

Installing extensions: sudo apk add php-zts-<extension>

For extensions not available by default, use PIE:

sudo apk add pie-zts
sudo pie-zts install asgrim/example-pie-extension

Homebrew

FrankenPHP is also available as a Homebrew package for macOS and Linux.

brew install dunglas/frankenphp/frankenphp

Installing extensions: Use PIE.

Usage

To serve the content of the current directory, run:

frankenphp php-server

You can also run command-line scripts with:

frankenphp php-cli /path/to/your/script.php

For the deb and rpm packages, you can also start the systemd service:

sudo systemctl start frankenphp

Docker

Alternatively, Docker images are available:

docker run -v .:/app/public \
    -p 80:80 -p 443:443 -p 443:443/udp \
    dunglas/frankenphp

Go to https://localhost, and enjoy!

Tip

Do not attempt to use https://127.0.0.1. Use https://localhost and accept the self-signed certificate. Use the SERVER_NAME environment variable to change the domain to use.

Docs

Examples and Skeletons