Skip to content

Commit

Permalink
docs: xcaddy build flags
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Dec 14, 2023
1 parent e20de21 commit 9992e7b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion docs/compile.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,20 @@ CGO_CFLAGS=$(php-config --includes) CGO_LDFLAGS="$(php-config --ldflags) $(php-c
Alternatively, use [xcaddy](https://github.com/caddyserver/xcaddy) to compile FrankenPHP with [custom Caddy modules](https://caddyserver.com/docs/modules/):

```console
CGO_ENABLED=1 xcaddy build \
CGO_ENABLED=1 \
XCADDY_GO_BUILD_FLAGS="-ldflags '-w -s'" \
xcaddy build \
--output frankenphp \
--with github.com/dunglas/frankenphp/caddy \
--with github.com/dunglas/mercure/caddy \
--with github.com/dunglas/vulcain/caddy
# Add extra Caddy modules here
```

> [!TIP]
>
> If you're using the musl libc (the default for Alpine Linux) and Symfony,
> you may need to increase the default stack size.
>
> To do so, to change the `XCADDY_GO_BUILD_FLAGS` environment variable to something like
> `XCADDY_GO_BUILD_FLAGS=$'-ldflags "-w -s -extldflags \'-Wl,-z,stack-size=0x80000\'"'`

0 comments on commit 9992e7b

Please sign in to comment.