File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111# Request limits
1212###
1313# Max request body size accepted by nginx. Must be >= PHP_UPLOAD_MAX_FILESIZE
14- # in .env.php, otherwise large uploads get truncated at the proxy. Default: 140m.
15- NGINX_MAX_BODY_SIZE=140m
14+ # in .env.php and >= MEDIA_MAX_UPLOAD_SIZE_MB in .env.symfony (app cap, default
15+ # 200 MiB), otherwise large uploads get truncated at the proxy. Default: 210m.
16+ NGINX_MAX_BODY_SIZE=210m
1617
1718###
1819# Upstream FPM (rarely needs tuning — only useful with custom topology)
Original file line number Diff line number Diff line change 1313PHP_MAX_EXECUTION_TIME=30
1414# Memory cap per PHP process. Default: 128M.
1515PHP_MEMORY_LIMIT=256M
16- # Total POST body size accepted by PHP. Default: 8M. Raise in lockstep with
17- # NGINX_MAX_BODY_SIZE.
18- PHP_POST_MAX_SIZE=140M
19- # Maximum size of an uploaded file. Default: 2M.
20- PHP_UPLOAD_MAX_FILESIZE=128M
16+ # Total POST body size accepted by PHP. Default: 8M. Keep in lockstep with
17+ # NGINX_MAX_BODY_SIZE and >= PHP_UPLOAD_MAX_FILESIZE plus multipart overhead.
18+ PHP_POST_MAX_SIZE=210M
19+ # Maximum size of an uploaded file. Default: 2M. The Symfony app caps media
20+ # uploads at MEDIA_MAX_UPLOAD_SIZE_MB (.env.symfony, default 200 MiB); this
21+ # must be >= that value, otherwise PHP rejects the upload before the app
22+ # validator sees it.
23+ PHP_UPLOAD_MAX_FILESIZE=200M
2124# Default timezone. Default: Europe/Copenhagen.
2225PHP_TIMEZONE=Europe/Copenhagen
2326
Original file line number Diff line number Diff line change @@ -45,6 +45,10 @@ See the [v2.x.x — Skipped](#v2xx---skipped) entry below for why this major ski
4545 ` logs:access ` , ` logs:disk ` .
4646- Global JSON-file log rotation (10MB × 3 files per service), tunable via ` LOG_MAX_SIZE ` /
4747 ` LOG_MAX_FILE ` .
48+ - Aligned media-upload limits with the upstream 3.0.0 app cap: ` .env.php.example ` ships
49+ ` PHP_UPLOAD_MAX_FILESIZE=200M ` / ` PHP_POST_MAX_SIZE=210M ` and ` .env.nginx.example ` ships
50+ ` NGINX_MAX_BODY_SIZE=210m ` , matching the new ` MEDIA_MAX_UPLOAD_SIZE_MB=200 ` Symfony validator
51+ ceiling that 3.0.0 introduces. UPGRADE.md §5 explains the four-layer alignment rule.
4852
4953### Local development
5054
Original file line number Diff line number Diff line change @@ -175,6 +175,25 @@ $EDITOR .env.mariadb
175175task env:traefik
176176```
177177
178+ ##### Media upload size: align all three layers
179+
180+ v3 adds an app-level cap on media uploads, ` MEDIA_MAX_UPLOAD_SIZE_MB ` (default ` 200 ` ,
181+ in MiB), enforced by the Symfony validator on ` Media::$file ` . Because uploads cross
182+ nginx → PHP-FPM → Symfony, all three layers must agree, or the lowest wins (and the
183+ operator sees a confusing 413 / ` UPLOAD_ERR_INI_SIZE ` instead of the app's clear
184+ "file exceeds N MiB" error). Defaults shipped in ` .env.php.example ` and
185+ ` .env.nginx.example ` are aligned to ` 200 ` ; if you've customised any of them, keep
186+ the inequality intact:
187+
188+ ``` text
189+ NGINX_MAX_BODY_SIZE >= PHP_POST_MAX_SIZE >= PHP_UPLOAD_MAX_FILESIZE >= MEDIA_MAX_UPLOAD_SIZE_MB
190+ ```
191+
192+ ` task env:migrate ` carries ` MEDIA_MAX_UPLOAD_SIZE_MB ` over from the image's bundled
193+ ` .env ` , so it lands in ` .env.symfony ` automatically. Verify with ` task env:diff ` after
194+ ` env:init ` — if the diff shows the key only on the image side, your migrated file
195+ predates this var and you should copy the line over by hand.
196+
178197#### 6. MariaDB 10.x → 11.4 upgrade
179198
180199The bundled MariaDB is ` mariadb:11.4.10 ` in 3.x (was ` mariadb:10.x ` in 1.x). Three things must
You can’t perform that action at this time.
0 commit comments