You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/compile.md
+40-22Lines changed: 40 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,13 +3,30 @@
3
3
This document explains how to create a FrankenPHP binary that will load PHP as a dynamic library.
4
4
This is the recommended method.
5
5
6
-
Alternatively, [static builds](static.md) can also be created.
6
+
Alternatively, [fully and mostly static builds](static.md) can also be created.
7
7
8
8
## Install PHP
9
9
10
10
FrankenPHP is compatible with PHP 8.2 and superior.
11
11
12
-
First, [get the PHP sources](https://www.php.net/downloads.php) and extract them:
12
+
### With Homebrew (Linux and Mac)
13
+
14
+
The easiest way to install a version of libphp compatible with FrankenPHP is to use the ZTS packages provided by [Homebrew PHP](https://github.com/shivammathur/homebrew-php).
15
+
16
+
First, if not already done, install [Homebrew](https://brew.sh).
17
+
18
+
Then, install the ZTS variant of PHP, Brotli (optional, for compression support) and watcher (optional, for file change detection):
| Restart workers on file change |[Watcher C](https://github.com/e-dant/watcher/tree/release/watcher-c)| nowatcher |
73
86
74
87
## Compile the Go App
75
88
76
-
You can now build the final binary:
77
-
78
-
```console
79
-
curl -L https://github.com/dunglas/frankenphp/archive/refs/heads/main.tar.gz | tar xz
80
-
cd frankenphp-main/caddy/frankenphp
81
-
CGO_CFLAGS=$(php-config --includes) CGO_LDFLAGS="$(php-config --ldflags) $(php-config --libs)" go build -tags=nobadger,nomysql,nopgx
82
-
```
89
+
You can now build the final binary.
83
90
84
91
### Using xcaddy
85
92
86
-
Alternatively, use [xcaddy](https://github.com/caddyserver/xcaddy) to compile FrankenPHP with [custom Caddy modules](https://caddyserver.com/docs/modules/):
93
+
The recommended way is to use [xcaddy](https://github.com/caddyserver/xcaddy) to compile FrankenPHP.
94
+
`xcaddy` also allows to easily add [custom Caddy modules](https://caddyserver.com/docs/modules/) and FrankenPHP extensions:
87
95
88
96
```console
89
97
CGO_ENABLED=1 \
@@ -95,7 +103,7 @@ xcaddy build \
95
103
--with github.com/dunglas/frankenphp/caddy \
96
104
--with github.com/dunglas/mercure/caddy \
97
105
--with github.com/dunglas/vulcain/caddy
98
-
# Add extra Caddy modules here
106
+
# Add extra Caddy modules and FrankenPHP extensions here
99
107
```
100
108
101
109
> [!TIP]
@@ -107,3 +115,13 @@ xcaddy build \
107
115
> To do so, change the `XCADDY_GO_BUILD_FLAGS` environment variable to something like
Copy file name to clipboardExpand all lines: docs/fr/compile.md
+39-21Lines changed: 39 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,23 @@ Alternativement, il est aussi possible de [créer des builds statiques](static.m
9
9
10
10
FrankenPHP est compatible avec PHP 8.2 et versions ultérieures.
11
11
12
+
### Avec Homebrew (Linux et Mac)
13
+
14
+
La manière la plus simple d'installer une version de libphp compatible avec FrankenPHP est d'utiliser les paquets ZTS fournis par [Homebrew PHP](https://github.com/shivammathur/homebrew-php).
15
+
16
+
Tout d'abord, si ce n'est déjà fait, installez [Homebrew](https://brew.sh).
17
+
18
+
Ensuite, installez la variante ZTS de PHP, Brotli (facultatif, pour la prise en charge de la compression) et watcher (facultatif, pour la détection des modifications de fichiers) :
0 commit comments