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/symfony.md
+16-71Lines changed: 16 additions & 71 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,35 +8,16 @@ For [Symfony](https://symfony.com) projects, we recommend using [Symfony Docker]
8
8
9
9
Alternatively, you can run your Symfony projects with FrankenPHP from your local machine:
10
10
11
-
1.[Download the binary corresponding to your system](../README.md#standalone-binary)
11
+
1.[Install FrankenPHP](../#getting-started)
12
12
2. Add the following configuration to a file named `Caddyfile` in the root directory of your Symfony project:
13
13
14
14
```caddyfile
15
15
# The domain name of your server
16
-
localhost {
17
-
# Set the webroot to the public/ directory
18
-
root public/
19
-
# Enable compression (optional)
20
-
encode zstd br gzip
21
-
22
-
23
-
# Rewrite requests to non-existing files to the front controller
24
-
@phpRoute {
25
-
not file {path}
26
-
}
27
-
rewrite @phpRoute index.php
28
-
29
-
@frontController path index.php
30
-
php @frontController {
31
-
# Optional: Enable worker mode for better performance
32
-
worker {
33
-
file ./public/index.php
34
-
}
35
-
}
36
-
37
-
file_server {
38
-
hide *.php
39
-
}
16
+
localhost
17
+
18
+
php_server {
19
+
# Optional: Enable worker mode for better performance
20
+
worker index.php
40
21
}
41
22
```
42
23
@@ -71,7 +52,7 @@ Learn more about [the worker mode](worker.md).
71
52
72
53
Hot reloading is enabled by default in [Symfony Docker](https://github.com/dunglas/symfony-docker).
73
54
74
-
To use the [hot reload](hot-reload.md) feature without Symfony Docker, enable [Mercure](mercure.md) and add the `hot_reload` sub-directive to the `php` directive in your `Caddyfile`:
55
+
To use the [hot reload](hot-reload.md) feature without Symfony Docker, enable [Mercure](mercure.md) and add the `hot_reload` sub-directive to the `php_server` directive in your `Caddyfile`:
75
56
76
57
```caddyfile
77
58
localhost
@@ -80,26 +61,9 @@ mercure {
80
61
anonymous
81
62
}
82
63
83
-
root public/
84
-
85
-
@phpRoute {
86
-
not path /.well-known/mercure*
87
-
not file {path}
88
-
}
89
-
rewrite @phpRoute index.php
90
-
91
-
@frontController path index.php
92
-
php @frontController {
64
+
php_server {
93
65
hot_reload
94
-
# Optional: enable worker in watch mode for better performance
0 commit comments