The modern PHP app server
Find a file
2025-12-15 20:13:15 +01:00
.github ci: verbose logs for StaticPHP (#2074) 2025-12-15 20:13:15 +01:00
caddy chore(caddy): bump github.com/spf13/cobra 2025-12-15 13:41:56 +01:00
docs feat(types): expose IsPacked to help dealing with hashmaps and lists in Go code 2025-12-15 15:35:21 +01:00
internal feat(extgen): add support for callable in parameters (#1731) 2025-12-15 12:50:50 +01:00
package give /var/lib/frankenphp sys_rw_content_t permissions for mercure.db files (#2037) 2025-11-28 11:11:28 +01:00
testdata feat: add support for structured logging with the frankenphp_log() PHP function (#1979) 2025-12-15 16:10:35 +01:00
.clang-format-ignore feat: mercure_publish() PHP function to dispatch Mercure updates (#1927) 2025-11-18 09:59:53 +01:00
.dockerignore ci: include version in BuildInfo and Prometheus metrics (#1418) 2025-03-19 13:27:28 +01:00
.editorconfig delete source/downloads after building in script, add .editorconfig (#2000) 2025-11-20 11:49:09 +01:00
.gitignore ci: build .rpm and .deb packages (#1497) 2025-05-14 07:33:05 +02:00
.gitleaksignore feat: mercure_publish() PHP function to dispatch Mercure updates (#1927) 2025-11-18 09:59:53 +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 delete source/downloads after building in script, add .editorconfig (#2000) 2025-11-20 11:49:09 +01: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 fox(static): add watcher to defaultExtensionLibs (#2039) 2025-11-27 00:10:41 +01:00
cgi.go refactor: extract the state module and make the backoff error instead of panic 2025-12-02 23:10:12 +01:00
cgo.go fix(ci): Docker builds 2025-07-17 10:14:18 +02:00
context.go fix: correctly set the Mercure hub for the main worker request 2025-11-24 11:21:45 +01:00
CONTRIBUTING.md chore: bump super-linter/super-linter/slim to 8.0.0 2025-08-18 10:45:38 +02: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 ci: PHP 8.5 (#2006) 2025-11-21 13:54:07 +01:00
dev.Dockerfile ci: PHP 8.5 (#2006) 2025-11-21 13:54:07 +01:00
docker-bake.hcl ci: verbose logs for StaticPHP (#2074) 2025-12-15 20:13:15 +01:00
Dockerfile ci: PHP 8.5 (#2006) 2025-11-21 13:54:07 +01:00
embed.go chore: various cleanups 2024-10-23 22:33:58 +02:00
env.go refactor: extract the state module and make the backoff error instead of panic 2025-12-02 23:10:12 +01:00
ext.go feat: FrankenPHP extensions (#1651) 2025-06-25 10:18:22 +02:00
frankenphp.c feat: add support for structured logging with the frankenphp_log() PHP function (#1979) 2025-12-15 16:10:35 +01:00
frankenphp.go feat: add support for structured logging with the frankenphp_log() PHP function (#1979) 2025-12-15 16:10:35 +01:00
frankenphp.h refactor: extract the state module and make the backoff error instead of panic 2025-12-02 23:10:12 +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 feat: add support for structured logging with the frankenphp_log() PHP function (#1979) 2025-12-15 16:10:35 +01:00
go.mod feat: add support for structured logging with the frankenphp_log() PHP function (#1979) 2025-12-15 16:10:35 +01:00
go.sh fix(ci): Docker builds 2025-07-17 10:14:18 +02:00
go.sum feat: add support for structured logging with the frankenphp_log() PHP function (#1979) 2025-12-15 16:10:35 +01:00
hotreload.go feat: hot reload (#2031) 2025-12-12 14:29:18 +01:00
install.sh deduplicate installation instructions in README(#2013) 2025-11-26 08:19:27 +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 fix: update mercure_publish() to use the new GoPackedArray() API 2025-12-13 19:30:22 +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 chore!: update to golangci-lint-action 7 (#1508) 2025-04-17 20:33:22 +02: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: hot reload (#2031) 2025-12-12 14:29:18 +01:00
phpmainthread.go refactor: extract the state module and make the backoff error instead of panic 2025-12-02 23:10:12 +01:00
phpmainthread_test.go feat: add support for structured logging with the frankenphp_log() PHP function (#1979) 2025-12-15 16:10:35 +01:00
phpthread.go refactor: extract the state module and make the backoff error instead of panic 2025-12-02 23:10:12 +01:00
README.md [docs] update other languages based on English (#2044) 2025-12-01 09:08:53 +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
request_options.go feat: worker matching (#1646) 2025-07-01 10:27:11 +02:00
scaling.go refactor: extract the state module and make the backoff error instead of panic 2025-12-02 23:10:12 +01:00
scaling_test.go feat: add support for structured logging with the frankenphp_log() PHP function (#1979) 2025-12-15 16:10:35 +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 refactor: extract the state module and make the backoff error instead of panic 2025-12-02 23:10:12 +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 refactor: extract the state module and make the backoff error instead of panic 2025-12-02 23:10:12 +01:00
types.c feat(extgen): add support for callable in parameters (#1731) 2025-12-15 12:50:50 +01:00
types.go feat(types): expose IsPacked to help dealing with hashmaps and lists in Go code 2025-12-15 15:35:21 +01:00
types.h feat(extgen): add support for callable in parameters (#1731) 2025-12-15 12:50:50 +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
watcher-skip.go feat: hot reload (#2031) 2025-12-12 14:29:18 +01:00
watcher.go feat: hot reload (#2031) 2025-12-12 14:29:18 +01:00
watcher_test.go feat: hot reload (#2031) 2025-12-12 14:29:18 +01:00
worker.go feat: hot reload (#2031) 2025-12-12 14:29:18 +01:00
worker_test.go feat: add support for structured logging with the frankenphp_log() PHP function (#1979) 2025-12-15 16:10:35 +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, 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

On Windows, use WSL to run FrankenPHP.

Install Script

You can copy this line into your terminal to automatically install an appropriate version for your platform:

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

Standalone Binary

We provide static FrankenPHP binaries for development purposes on Linux and macOS containing PHP 8.4 and most popular PHP extensions.

Download FrankenPHP

Installing extensions: Most common extensions are bundled. It's not possible to install more extensions.

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.4 # 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:

sudo curl -fsSL https://key.henderkes.com/static-php.gpg -o /usr/share/keyrings/static-php.gpg && \
echo "deb [signed-by=/usr/share/keyrings/static-php.gpg] https://deb.henderkes.com/ stable main" | sudo tee /etc/apt/sources.list.d/static-php.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

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