Skip to content

Sapi/frankenphp #772

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 54 commits into from
Jun 19, 2025
Merged

Sapi/frankenphp #772

merged 54 commits into from
Jun 19, 2025

Conversation

henderkes
Copy link
Collaborator

What does this PR do?

adds support for the FrankenPHP sapi (linux, macos, bsd)

Checklist before merging

If your PR involves the changes mentioned below and completed the action, please tick the corresponding option.
If a modification is not involved, please skip it directly.

  • If you modified *.php, run composer cs-fix at local machine.
  • If it's an extension or dependency update, make sure adding related extensions in src/global/test-extensions.php.
  • If you changed the behavior of static-php-cli, update docs in ./docs/.
  • If you updated config/xxx.json content, run bin/spc dev:sort-config xxx.

crazywhalecc and others added 19 commits June 14, 2025 02:06
{craft}
extensions: curl,ast
sapi: cli,micro
{/craft}
{craft}
extensions: curl,ast
sapi: cli,micro
{/craft}
{craft}
extensions: curl,ast
sapi: cli,micro
{/craft}
{craft}
extensions: curl,ast
sapi: cli,micro
{/craft}
{craft}
extensions: bcmath
shared-extensions: xdebug,swoole
sapi: cli
{/craft}
[spc_prefix:bin/spc-gnu-docker]
…ing frankenphp after compiling a different version
@henderkes henderkes requested a review from crazywhalecc June 18, 2025 04:31
@henderkes
Copy link
Collaborator Author

Hahaha, I found a frankenphp bug. The php-server directive unconditionally enables brotli encoding.

Copy link
Owner

@crazywhalecc crazywhalecc left a comment

Choose a reason for hiding this comment

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

I'm still looking for ways to separate downloading and building, but for now it looks almost impossible to use xcaddy build instead of go build.

@@ -42,6 +42,9 @@ SPC_CONCURRENCY=${CPU_COUNT}
SPC_SKIP_PHP_VERSION_CHECK="no"
; Ignore some check item for bin/spc doctor command, comma separated (e.g. SPC_SKIP_DOCTOR_CHECK_ITEMS="if homebrew has installed")
SPC_SKIP_DOCTOR_CHECK_ITEMS=""
; extra modules that xcaddy will include in the FrankenPHP build
SPC_CMD_VAR_FRANKENPHP_XCADDY_MODULES="--with github.com/dunglas/frankenphp/caddy --with github.com/dunglas/mercure/caddy --with github.com/dunglas/vulcain/caddy --with github.com/dunglas/caddy-cbrotli"
Copy link
Owner

Choose a reason for hiding this comment

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

Are these modules required all the time? If so, it would be better to add them as dependencies directly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

They are used in the official frankenphp build, so I set it as an overridable option.

I personally build without vulcain but with caddy cache and supervisor.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

(also, again, can't download them earlier as it's part of xcaddy's process)

@crazywhalecc
Copy link
Owner

Oh, we merge into the docs branch?

@henderkes
Copy link
Collaborator Author

I'm still looking for ways to separate downloading and building, but for now it looks almost impossible to use xcaddy build instead of go build.

Yeah, like I said earlier, I don't think there's a good way. It will have to do some downloading every time we build (it also updates modules every time), the only way around that would be incredibly tedious by not going with xcaddy at all.

@henderkes
Copy link
Collaborator Author

Oh, we merge into the docs branch?

yes, it needs some changes I've made there for the packaging to even work properly

@crazywhalecc crazywhalecc changed the base branch from docs to main June 19, 2025 02:21
@crazywhalecc crazywhalecc changed the base branch from main to docs June 19, 2025 02:21
@crazywhalecc
Copy link
Owner

yes, it needs some changes I've made there for the packaging to even work properly

But I haven't fully reviewed the docs branch yet, and it seems there are some unfinished parts.

@henderkes
Copy link
Collaborator Author

henderkes commented Jun 19, 2025

and it seems there are some unfinished parts.

I don't think so. These changes here more or less complete it.

This branch was based off of the docs branch in the first place, it has all of its changes in here.

@henderkes henderkes merged commit 3af40a6 into docs Jun 19, 2025
1 check passed
@henderkes henderkes deleted the sapi/frankenphp branch June 19, 2025 02:30
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.

2 participants