Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/compile.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Compile FrankenPHP from sources with libphp.so
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.
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.
---

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

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

> [!NOTE]
>
> To compile FrankenPHP on Windows, follow [the Windows Development section of the contributing documentation](https://frankenphp.dev/docs/contributing/#windows-development).

## Install PHP

FrankenPHP is compatible with PHP 8.2 and higher.
Expand Down
49 changes: 47 additions & 2 deletions docs/production.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Deploying FrankenPHP in production with Docker Compose
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.
title: Deploying FrankenPHP in production
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.
---

# Deploying in production
Expand Down Expand Up @@ -171,3 +171,48 @@ which can cause issues like incorrect HTTPS detection or wrong client IP address
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/),
which is compatible with the provided Compose files.
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.

## Deploying on Windows

FrankenPHP runs natively on Windows, with full support for [the worker mode](worker.md) and [hot reloading](hot-reload.md).

To install it, run this in PowerShell:

```powershell
irm https://frankenphp.dev/install.ps1 | iex
```

Alternatively, [download the Windows archive from the releases page](https://github.com/php/frankenphp/releases).
It contains the FrankenPHP executable as well as the official PHP binary for Windows.

To run FrankenPHP in the background and start it automatically at boot, register it as a Windows service.
As [recommended by the Caddy documentation](https://caddyserver.com/docs/running#windows-service), use [WinSW](https://github.com/winsw/winsw):

1. Download [the latest version of WinSW](https://github.com/winsw/winsw/releases) as `frankenphp-service.exe` in the directory containing `frankenphp.exe`
2. In the same directory, create a `frankenphp-service.xml` file:

```xml
<service>
<id>frankenphp</id>
<name>FrankenPHP</name>
<description>The modern PHP app server (https://frankenphp.dev)</description>
<executable>%BASE%\frankenphp.exe</executable>
<arguments>run --config %BASE%\Caddyfile</arguments>
<log mode="roll-by-time">
<pattern>yyyy-MM-dd</pattern>
</log>
</service>
```

3. Install and start the service:

```powershell
.\frankenphp-service.exe install
.\frankenphp-service.exe start
```

Windows services cannot be reloaded. To apply configuration changes gracefully, without restarting the service, run:

```powershell
.\frankenphp.exe reload --config Caddyfile
```