mirror of
https://github.com/librespeed/speedtest.git
synced 2026-07-03 07:13:13 +00:00
speedtest_worker.js uploads in 20 MB chunks by default (xhr_ul_blob_megabytes: 20) but the official Docker images inherit PHP's stock post_max_size = 8M / upload_max_filesize = 2M, so every upload chunk: * triggers a "POST Content-Length ... exceeds the limit" warning (leaked into the response body of /backend/empty.php on the Debian variant where display_errors is on; suppressed but still emitted on Alpine where it's off); * causes empty.php's subsequent header() calls to fail with "Cannot modify header information - headers already sent", leaving the response without proper status, cache, or CORS directives. Ship a small docker/librespeed-php.ini with post_max_size = 32M, upload_max_filesize = 32M, memory_limit = 256M and COPY it into the right conf.d for each base image (/usr/local/etc/php/conf.d on Debian, /etc/php84/conf.d on Alpine). 99- prefix follows the NN-name.ini packaging convention so this loads after distro defaults but never silently shadows operator overrides. Verified post-fix on both variants: a 20 MB POST to /backend/empty.php returns HTTP 200 / 0 bytes with no warning leakage.
18 lines
743 B
INI
18 lines
743 B
INI
; LibreSpeed-recommended PHP override.
|
|
;
|
|
; speedtest_worker.js uploads in 20 MB chunks by default
|
|
; (xhr_ul_blob_megabytes: 20). PHP's stock post_max_size = 8M rejects
|
|
; every chunk: PHP emits a "POST Content-Length ... exceeds the
|
|
; limit" startup warning and prevents empty.php from sending its
|
|
; response headers (Cache-Control, Pragma, Connection, and CORS
|
|
; under ?cors).
|
|
;
|
|
; The upload throughput number itself is unaffected — the worker
|
|
; reads bytes-on-wire from xhr.upload.onprogress, not the response
|
|
; body — but the response from empty.php is otherwise malformed.
|
|
;
|
|
; 32M is the next round number above the worker's 20M default; it
|
|
; leaves headroom for operators who tune xhr_ul_blob_megabytes
|
|
; upwards.
|
|
|
|
post_max_size = 32M
|