Skip to content

Commit a590f46

Browse files
committed
blog: update FrankenPHP instructions
1 parent 3e4dd04 commit a590f46

7 files changed

+17
-77
lines changed
-6.32 KB
Loading
-8.33 KB
Loading
-7.28 KB
Loading
660 Bytes
Loading
-822 Bytes
Loading
-5.94 KB
Loading

src/content/blog/using-frankenphp-with-ddev.md

Lines changed: 17 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
title: "Using FrankenPHP with DDEV"
33
pubDate: 2025-07-03
4-
modifiedDate: 2025-11-27
5-
modifiedComment: The FrankenPHP add-on is now official.
4+
modifiedDate: 2025-12-30
5+
modifiedComment: Update FrankenPHP add-on instructions, remove deprecated content, update benchmark results.
66
summary: Learn how to use FrankenPHP with DDEV through the official add-on or Debian packages. Includes installation steps, features, and performance benchmarks.
77
author: Stas Zhuk
88
featureImage:
@@ -20,16 +20,13 @@ The PHP ecosystem is changing fast, with tools like [FrankenPHP](https://franken
2020

2121
FrankenPHP is now [officially supported](https://thephp.foundation/blog/2025/05/15/frankenphp/) by The PHP Foundation.
2222

23-
This guide explains two ways to integrate FrankenPHP with DDEV:
24-
25-
1. **Official DDEV add-on** (recommended): Run FrankenPHP as a separate service with full PHP extension support and flexibility
26-
2. **Debian packages**: Install FrankenPHP directly in the web container (PHP 8.4 only, limited features)
23+
This guide explains how FrankenPHP can be used with DDEV using [ddev/ddev-frankenphp](https://github.com/ddev/ddev-frankenphp) add-on.
2724

2825
### Generic web server
2926

3027
This blog shows examples of the recently added [DDEV's generic web server](https://docs.ddev.com/en/stable/users/extend/customization-extendibility/#using-nodejs-as-ddevs-primary-web-server), which supports flexible configurations. It allows you to use any custom web server you want, including Node.js, Python, Ruby, etc.
3128

32-
## DDEV FrankenPHP Add-on (Recommended)
29+
## DDEV FrankenPHP Add-on
3330

3431
The [ddev/ddev-frankenphp](https://github.com/ddev/ddev-frankenphp) add-on is now officially maintained by the DDEV team! It has matured to production-ready status with full feature support.
3532

@@ -40,11 +37,12 @@ ddev add-on get ddev/ddev-frankenphp
4037
ddev restart
4138
```
4239

43-
To add PHP extensions (see supported extensions [here](https://github.com/mlocati/docker-php-extension-installer?tab=readme-ov-file#supported-php-extensions)):
40+
Install pre-packaged extensions using the `php-zts-` prefix (see [supported extensions](https://pkg.henderkes.com/84/php-zts/packages?type=debian)):
4441

4542
```bash
46-
ddev dotenv set .ddev/.env.web --frankenphp-custom-extensions="redis memcached"
47-
ddev stop && ddev debug rebuild && ddev start
43+
# install mongodb and sqlsrv extensions
44+
ddev config --webimage-extra-packages="php-zts-mongodb,php-zts-sqlsrv"
45+
ddev restart
4846
```
4947

5048
### ✨ Features:
@@ -53,83 +51,25 @@ ddev stop && ddev debug rebuild && ddev start
5351
- Install any PHP extension (Redis, Xdebug, Memcached, etc.)
5452
- Custom FrankenPHP options supported
5553
- Worker mode supported for maximum performance
56-
- Full debugging support: [`ddev xdebug`](https://docs.ddev.com/en/stable/users/usage/commands/#xdebug), [`ddev xhprof`](https://docs.ddev.com/en/stable/users/usage/commands/#xhprof), [`ddev xhgui`](https://docs.ddev.com/en/stable/users/usage/commands/#xhgui)
57-
58-
Note: Initial `ddev start` takes longer due to manual extension compilation.
54+
- Full debugging support: [`ddev blackfire`](https://docs.ddev.com/en/stable/users/usage/commands/#blackfire), [`ddev xdebug`](https://docs.ddev.com/en/stable/users/usage/commands/#xdebug), [`ddev xhprof`](https://docs.ddev.com/en/stable/users/usage/commands/#xhprof), [`ddev xhgui`](https://docs.ddev.com/en/stable/users/usage/commands/#xhgui)
5955

6056
If you want to suggest some feature or found a bug, feel free to [open an issue](https://github.com/ddev/ddev-frankenphp/issues).
6157

62-
## Alternative: FrankenPHP via Debian Packages
63-
64-
FrankenPHP can also be installed directly in the web container using Debian packages. This example from the [DDEV quickstart](https://docs.ddev.com/en/stable/users/quickstart/#generic-frankenphp) shows a setup for a Drupal 11 project where FrankenPHP runs as an extra daemon.
65-
66-
### ⚙️ Installation:
67-
68-
```bash
69-
export FRANKENPHP_SITENAME=my-frankenphp-site
70-
mkdir ${FRANKENPHP_SITENAME} && cd ${FRANKENPHP_SITENAME}
71-
ddev config --project-type=drupal11 --webserver-type=generic --docroot=web --php-version=8.4
72-
ddev start
73-
74-
cat <<'EOF' > .ddev/config.frankenphp.yaml
75-
web_extra_daemons:
76-
- name: "frankenphp"
77-
command: "frankenphp php-server --listen=0.0.0.0:80 --root=\"/var/www/html/${DDEV_DOCROOT:-}\" -v -a"
78-
directory: /var/www/html
79-
web_extra_exposed_ports:
80-
- name: "frankenphp"
81-
container_port: 80
82-
http_port: 80
83-
https_port: 443
84-
EOF
85-
86-
cat <<'DOCKERFILEEND' >.ddev/web-build/Dockerfile.frankenphp
87-
RUN curl -fsSL https://key.henderkes.com/static-php.gpg -o /usr/share/keyrings/static-php.gpg && \
88-
echo "deb [signed-by=/usr/share/keyrings/static-php.gpg] https://deb.henderkes.com/ stable main" > /etc/apt/sources.list.d/static-php.list
89-
# Install FrankenPHP and extensions, see https://frankenphp.dev/docs/#deb-packages for details.
90-
# You can find the list of available extensions at https://deb.henderkes.com/pool/main/p/
91-
RUN (apt-get update || true) && DEBIAN_FRONTEND=noninteractive apt-get install -y -o Dpkg::Options::="--force-confnew" --no-install-recommends --no-install-suggests \
92-
frankenphp \
93-
php-zts-cli \
94-
php-zts-gd \
95-
php-zts-pdo-mysql
96-
# Make sure that 'php' command uses the ZTS version of PHP
97-
# and that the php.ini in use by FrankenPHP is the one from DDEV.
98-
RUN ln -sf /usr/bin/php-zts /usr/local/bin/php && \
99-
ln -sf /etc/php/${DDEV_PHP_VERSION}/fpm/php.ini /etc/php-zts/php.ini
100-
DOCKERFILEEND
101-
102-
ddev composer create-project drupal/recommended-project
103-
ddev composer require drush/drush
104-
ddev restart
105-
ddev drush site:install demo_umami --account-name=admin --account-pass=admin -y
106-
ddev launch
107-
# or automatically log in with
108-
ddev launch $(ddev drush uli)
109-
```
110-
111-
### ⚠️ Limitations:
112-
113-
- PHP 8.4 only (no version flexibility)
114-
- Cannot customize FrankenPHP options
115-
- Worker mode not supported
116-
- No debugging support (`ddev xdebug`, `ddev xhprof`, `ddev xhgui` do not work)
117-
11858
## Resources
11959

12060
- [FrankenPHP documentation](https://frankenphp.dev/docs/)
12161
- [DDEV's generic web server](https://docs.ddev.com/en/stable/users/extend/customization-extendibility/#using-nodejs-as-ddevs-primary-web-server)
12262
- [FrankenPHP add-on](https://github.com/ddev/ddev-frankenphp)
123-
- [FrankenPHP quickstart](https://docs.ddev.com/en/stable/users/quickstart/#generic-frankenphp)
63+
- [FrankenPHP Static PHP Package Repository](https://debs.henderkes.com/)
12464
- [Hola FrankenPHP! Laravel Octane Servers Comparison: Pushing the Boundaries of Performance](https://medium.com/beyn-technology/hola-frankenphp-laravel-octane-servers-comparison-pushing-the-boundaries-of-performance-d3e7ad8e652c)
12565

12666
## Benchmarking
12767

12868
Using [ddev-frankenphp-benchmark](https://github.com/stasadev/ddev-frankenphp-benchmark), I compared three setups:
12969

13070
- `nginx-fpm`: DDEV's `nginx-fpm` web server with `php-fpm`
131-
- `generic-web`: DDEV's `generic` web server with FrankenPHP inside the `web` container (static binary)
132-
- `generic-addon`: DDEV's `generic` web server with FrankenPHP inside the `frankenphp` container (with `pdo_mysql` extension)
71+
- `apache-fpm`: DDEV's `apache-fpm` web server with `php-fpm`
72+
- `frankenphp-addon`: DDEV's `generic` web server with `frankenphp`
13373

13474
Summary:
13575

@@ -142,14 +82,14 @@ Summary:
14282
### Benchmarking Results
14383

14484
<b>Software:</b><br>
145-
DDEV: v1.24.6<br>
85+
DDEV: v1.24.10<br>
14686
Mutagen: disabled<br>
14787
PHP: v8.4<br>
148-
Laravel: v12.19.3<br>
149-
FrankenPHP: v1.7.0<br>
150-
Docker Engine: v28.3.0<br>
88+
Laravel: v12.44.0<br>
89+
FrankenPHP: v1.11.1<br>
90+
Docker Engine: v29.1.3<br>
15191
Operating System: Manjaro Linux AMD64<br>
152-
Kernel Version: 6.12.35-1-MANJARO
92+
Kernel Version: 6.12.63-1-MANJARO
15393

15494
<b>Hardware:</b><br>
15595
Intel i7 8750H (6 Core/12 Thread, 2.2 Ghz, Turbo 4.1 Ghz)<br>

0 commit comments

Comments
 (0)