
* create a simple thread framework Signed-off-by: Robert Landers <landers.robert@gmail.com> * add tests Signed-off-by: Robert Landers <landers.robert@gmail.com> * fix comment Signed-off-by: Robert Landers <landers.robert@gmail.com> * remove mention of an old function that no longer exists Signed-off-by: Robert Landers <landers.robert@gmail.com> * simplify providing a request Signed-off-by: Robert Landers <landers.robert@gmail.com> * satisfy linter Signed-off-by: Robert Landers <landers.robert@gmail.com> * add error handling and handle shutdowns Signed-off-by: Robert Landers <landers.robert@gmail.com> * add tests Signed-off-by: Robert Landers <landers.robert@gmail.com> * pipes are tied to workers, not threads Signed-off-by: Robert Landers <landers.robert@gmail.com> * fix test Signed-off-by: Robert Landers <landers.robert@gmail.com> * add a way to detect when a request is completed Signed-off-by: Robert Landers <landers.robert@gmail.com> * we never shutdown workers or remove them, so we do not need this Signed-off-by: Robert Landers <landers.robert@gmail.com> * add more comments Signed-off-by: Robert Landers <landers.robert@gmail.com> * Simplify modular threads (#1874) * Simplify * remove unused variable * log thread index * feat: allow passing parameters to the PHP callback and accessing its return value (#1881) * fix formatting Signed-off-by: Robert Landers <landers.robert@gmail.com> * fix test compilation Signed-off-by: Robert Landers <landers.robert@gmail.com> * fix segfaults Signed-off-by: Robert Landers <landers.robert@gmail.com> * Update frankenphp.c Co-authored-by: Kévin Dunglas <kevin@dunglas.fr> --------- Signed-off-by: Robert Landers <landers.robert@gmail.com> Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
FrankenPHP: Modern App Server for PHP
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:
Getting Started
Standalone Binary
We provide static FrankenPHP binaries for Linux and macOS containing PHP 8.4 and most popular PHP extensions.
On Windows, use WSL to run FrankenPHP.
Download FrankenPHP or copy this line into your terminal to automatically install the version appropriate for your platform:
curl https://frankenphp.dev/install.sh | sh
mv frankenphp /usr/local/bin/
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
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
. Usehttps://localhost
and accept the self-signed certificate. Use theSERVER_NAME
environment variable to change the domain to use.
Homebrew
FrankenPHP is also available as a Homebrew package for macOS and Linux.
To install it:
brew install dunglas/frankenphp/frankenphp
To serve the content of the current directory, run:
frankenphp php-server
Docs
- Classic mode
- Worker mode
- Early Hints support (103 HTTP status code)
- Real-time
- Efficiently Serving Large Static Files
- Configuration
- Writing PHP Extensions in Go
- Docker images
- Deploy in production
- Performance optimization
- Create standalone, self-executable PHP apps
- Create static binaries
- Compile from sources
- Monitoring FrankenPHP
- Laravel integration
- Known issues
- Demo app (Symfony) and benchmarks
- Go library documentation
- Contributing and debugging