Repository navigation
Conversation
Worker filenames are always resolved through symlinks, but a document root whose symlinks are kept builds SCRIPT_FILENAME from the declared path, so the lookup missed and the request ran outside worker mode. Also index each worker under its declared absolute path. Fixes #2736
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2736.
Since 1.13.0, a
php_serverworker is never selected whenresolve_root_symlink falseis set and the root is a symlink: requests run on a regular thread and the script fails with "FrankenPHP must be in worker mode".resolveWorkerFile()always resolves symlinks in the worker filename, and workers are indexed under that path. Withresolve_root_symlink false, the document root keeps its symlinked path, soSCRIPT_FILENAMEis the declared path and theworkersByPathlookup misses. Before #2499, the Caddy module matched workers against the unresolved path itself and passed the worker by name, which hid the mismatch.Workers are now also indexed under their declared absolute path, in both
Server.workersByPathandglobalWorkersByPath. The extra key cannot collide with another worker: a declared path that differs from its resolved form contains a symlink, and resolved paths never do.The new
PhpServerWorkerWithoutResolveRootSymlinktest reproduces the reporter's setup and fails without the fix.