Skip to content

Commit 0038532

Browse files
committed
docs: deploying on Windows
1 parent 1f216dd commit 0038532

2 files changed

Lines changed: 52 additions & 3 deletions

File tree

docs/compile.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Compile FrankenPHP from sources with libphp.so
3-
description: Build FrankenPHP from source on Linux, macOS and FreeBSD, linking PHP as a shared library via xcaddy or go build, and add custom Caddy modules and extensions.
3+
description: Build FrankenPHP from source on Linux, macOS, FreeBSD and Windows, linking PHP as a shared library via xcaddy or go build, and add custom Caddy modules and extensions.
44
---
55

66
# Compile from sources
@@ -10,6 +10,10 @@ This is the recommended method.
1010

1111
Alternatively, [fully and mostly static builds](static.md) can also be created.
1212

13+
> [!NOTE]
14+
>
15+
> To compile FrankenPHP on Windows, follow [the Windows Development section of the contributing documentation](https://frankenphp.dev/docs/contributing/#windows-development).
16+
1317
## Install PHP
1418

1519
FrankenPHP is compatible with PHP 8.2 and higher.

docs/production.md

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Deploying FrankenPHP in production with Docker Compose
3-
description: Deploy a PHP application to production with FrankenPHP and Docker Compose on a single Linux server, including TLS, reverse proxy, and multi-node setups.
2+
title: Deploying FrankenPHP in production
3+
description: Deploy a PHP application to production with FrankenPHP and Docker Compose on a single Linux server, including TLS, reverse proxy, and multi-node setups, or natively on Windows.
44
---
55

66
# Deploying in production
@@ -171,3 +171,48 @@ which can cause issues like incorrect HTTPS detection or wrong client IP address
171171
If you want to deploy your app on a cluster of machines, you can use [Docker Swarm](https://docs.docker.com/engine/swarm/stack-deploy/),
172172
which is compatible with the provided Compose files.
173173
To deploy on Kubernetes, take a look at [the Helm chart provided with API Platform](https://api-platform.com/docs/deployment/kubernetes/), which uses FrankenPHP.
174+
175+
## Deploying on Windows
176+
177+
FrankenPHP runs natively on Windows, with full support for [the worker mode](worker.md) and [hot reloading](hot-reload.md).
178+
179+
To install it, run this in PowerShell:
180+
181+
```powershell
182+
irm https://frankenphp.dev/install.ps1 | iex
183+
```
184+
185+
Alternatively, [download the Windows archive from the releases page](https://github.com/php/frankenphp/releases).
186+
It contains the FrankenPHP executable as well as the official PHP binary for Windows.
187+
188+
To run FrankenPHP in the background and start it automatically at boot, register it as a Windows service.
189+
As [recommended by the Caddy documentation](https://caddyserver.com/docs/running#windows-service), use [WinSW](https://github.com/winsw/winsw):
190+
191+
1. Download [the latest version of WinSW](https://github.com/winsw/winsw/releases) as `frankenphp-service.exe` in the directory containing `frankenphp.exe`
192+
2. In the same directory, create a `frankenphp-service.xml` file:
193+
194+
```xml
195+
<service>
196+
<id>frankenphp</id>
197+
<name>FrankenPHP</name>
198+
<description>The modern PHP app server (https://frankenphp.dev)</description>
199+
<executable>%BASE%\frankenphp.exe</executable>
200+
<arguments>run --config %BASE%\Caddyfile</arguments>
201+
<log mode="roll-by-time">
202+
<pattern>yyyy-MM-dd</pattern>
203+
</log>
204+
</service>
205+
```
206+
207+
3. Install and start the service:
208+
209+
```powershell
210+
.\frankenphp-service.exe install
211+
.\frankenphp-service.exe start
212+
```
213+
214+
Windows services cannot be reloaded. To apply configuration changes gracefully, without restarting the service, run:
215+
216+
```powershell
217+
.\frankenphp.exe reload --config Caddyfile
218+
```

0 commit comments

Comments
 (0)