From d426ad601ff38e5f6a05a4e4127c4e5e77529d66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Fri, 9 Oct 2026 22:19:56 +0200 Subject: [PATCH] fix: set REQUEST_URI when booting workers Since the php_server unification, the context used to boot workers no longer sets requestURI, so $_SERVER['REQUEST_URI'] is empty during boot. Nextcloud compares it to its web root and exits before reaching frankenphp_handle_request(), which makes startup fail. Fixes https://github.com/php/frankenphp/issues/2697 --- context.go | 4 ++++ testdata/worker-boot-request-uri.php | 14 ++++++++++++++ worker_test.go | 13 +++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 testdata/worker-boot-request-uri.php diff --git a/context.go b/context.go index bed3b36e14..ace1e3dcdf 100644 --- a/context.go +++ b/context.go @@ -155,6 +155,10 @@ func newWorkerDummyContext(w *worker) (*frankenPHPContext, error) { } } + if fc.requestURI == "" { + fc.requestURI = r.URL.RequestURI() + } + splitCgiPath(fc) return fc, nil diff --git a/testdata/worker-boot-request-uri.php b/testdata/worker-boot-request-uri.php new file mode 100644 index 0000000000..72615c2d56 --- /dev/null +++ b/testdata/worker-boot-request-uri.php @@ -0,0 +1,14 @@ +