Skip to content

Conversation

@AlliBalliBaba
Copy link
Contributor

Should fix #1723

The root defined in php_server was never really forwarded to try_files, which led to potentially confusing behavior where the file_server root (coming from php_server) and the try_files root (coming from the caddy route) would differ.

@AlliBalliBaba
Copy link
Contributor Author

This behavior is probably also broken in the php_fast_cgi implementation

@henderkes
Copy link
Contributor

Looks good, we should also try to upstream this to Caddy.

TryFiles: tryFiles,
TryPolicy: tryPolicy,
SplitPath: extensions,
Root: phpsrv.Root,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one question though because I currently can't test it - this still falls back to Caddy's root if the one in phpsrv is empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it will fallback, an empty string is the default in the struct (otherwise tests would also fail)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add some more tests for all cases

@AlliBalliBaba
Copy link
Contributor Author

Hmm not sure if this is also an issue upstream since the file_server is not built in in that case. Would need to actually test with an actual installation.

@dunglas dunglas merged commit a19fcdb into main Jul 16, 2025
22 checks passed
@dunglas dunglas deleted the fix/php-server-root branch July 16, 2025 09:58
@dunglas
Copy link
Member

dunglas commented Jul 16, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Running FrankenPHP from Symfony project root does not work

4 participants