FrankenPHP is a modern application server for PHP built on top of the Caddy web server.
This add-on integrates FrankenPHP into your DDEV project as an extra service.
Running it as a separate service lets you install additional PHP extensions. This differs from the official quckstart and another add-on, which bundle a static FrankenPHP build inside the web
container.
ddev config --webserver-type=generic
ddev add-on get stasadev/ddev-frankenphp
ddev restart
After installation, make sure to commit the .ddev
directory to version control.
Command | Description |
---|---|
ddev describe |
View service status and ports used by FrankenPHP |
ddev php |
Run PHP in the FrankenPHP container |
ddev exec -s frankenphp bash |
Enter the FrankenPHP container |
ddev logs -s frankenphp -f |
View FrankenPHP logs |
.ddev/docker-compose.frankenphp_extra.yaml
file: services:
frankenphp:
extra_hosts:
- "host.docker.internal:host-gateway"
IP_ADDRESS
with IP from the ddev exec ping -c1 host.docker.internal
command: services:
frankenphp:
extra_hosts:
- "host.docker.internal:IP_ADDRESS"
ddev xdebug
is only designed to work in the web
container, it won’t work here.ddev launch
doesn’t work. Open the website URL directly in your browser.To change the Docker image:
ddev dotenv set .ddev/.env.frankenphp --frankenphp-docker-image="dunglas/frankenphp:php8.3"
ddev add-on get stasadev/ddev-frankenphp
ddev stop && ddev debug rebuild -s frankenphp && ddev start
Make sure to commit the .ddev/.env.frankenphp
file to version control.
To add PHP extensions (see supported extensions here):
ddev dotenv set .ddev/.env.frankenphp --frankenphp-php-extensions="opcache xdebug spx"
ddev add-on get stasadev/ddev-frankenphp
ddev stop && ddev debug rebuild -s frankenphp && ddev start
Make sure to commit the .ddev/.env.frankenphp
file to version control.
All customization options (use with caution):
Variable | Flag | Default |
---|---|---|
FRANKENPHP_DOCKER_IMAGE |
--frankenphp-docker-image |
dunglas/frankenphp:php8.3 |
FRANKENPHP_PHP_EXTENSIONS |
--frankenphp-php-extensions |
opcache xdebug |
Contributed and maintained by @stasadev