Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: embed PHP thanks to FrankenPHP#216

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
dunglas wants to merge2 commits intosymfony-cli:main
base:main
Choose a base branch
Loading
fromdunglas:feat/frankenphp

Conversation

@dunglas
Copy link

@dunglasdunglas commentedNov 12, 2022
edited
Loading

Thanks toFrankenPHP, it's possible to embed PHP directly in the Symfony Local Web Server.
That's what this patch does!

symfony server:start --frankenphp

image

Basically, that means that you don't need a local installation of PHP anymore.

The code is working, but the build chain isn't ready. We'll have to buildlibphp in the CI and statically link the produced binary against it.

Support for other PHP SAPI is still included and FrankenPHP is currently opt-in.

Current limitations are:

Needssymfony-cli/phpstore#3

chapterjason and creocoder reacted with thumbs up emojikevinpapst, shyim, and cafferata reacted with thumbs down emojiGromNaN, alessandro-podo, OnurGvnc, chapterjason, and creocoder reacted with hooray emojiGromNaN, alessandro-podo, OnurGvnc, and creocoder reacted with heart emojisuasgn, chapterjason, Kocal, and 94noni reacted with eyes emoji
"path/filepath"
"syscall"

"github.com/dunglas/frankenphp"
Copy link
Contributor

@shyimshyimNov 13, 2022
edited
Loading

Choose a reason for hiding this comment

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

Does it make sense to have here a go build tag? Frankenphp uses a lot of cgo which would break the release ci pipeline as it's not possible to cross compile anymore 🤔

Copy link
Author

Choose a reason for hiding this comment

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

We could do that, but first I'll try to have to build a release pipeline supporting all current targets (they are supported by PHP, and we can use Docker to cross-compile).

@Kocal
Copy link
Contributor

Kocal commentedNov 13, 2022
edited
Loading

That's a great initiative, but would it support the.php-version feature?

@dunglas
Copy link
Author

@Kocal not yet. FrankenPHP is only compatible with PHP 8.2+.

Kocal reacted with thumbs up emoji

@kevinpapst
Copy link

How much will that increase the size of the Symfony binary? Why does one tool have to solve all issues?

@stof
Copy link

As we still need to have a local PHP setup for the CLI (a Symfony project requires a PHP CLI, at least to run composer), is there any benefit for that ? This only saves installing thephp-fpm package locally in addition to all the other packages that are shared with thephp-cli one.

@tucksaun
Copy link
Member

How much will that increase the size of the Symfony binary ?

I would say about 100mb (rough estimate)

As we still need to have a local PHP setup for the CLI (a Symfony project requires a PHP CLI, at least to run composer), is there any benefit for that ? This only saves installing the php-fpm package locally in addition to all the other packages that are shared with the php-cli one.

I agree.

Also we lose the multi version support and we don't expose the configurability of Franken so no big win here I think.

@tucksaun
Copy link
Member

Maybe we can do something by working wi Go plugins to have this optional?
or reuse the fact we can talk HTTP or CGI with the backend server?

@dunglas
Copy link
Author

@stof, FrankenPHP now natively supports CLI scripts too. The Caddy plugin already has this feature, this should be easy to add to Symfony CLI.

chapterjason reacted with rocket emoji

@dunglas
Copy link
Author

dunglas commentedNov 20, 2023
edited
Loading

Also, FrankenPHP supports libphp.so in addition to static builds, so it should be possible to distribute (or , better, download on demand) different PHP versions, for instance from the PHP Builder project (also used by setup-php), which provides dynamic libphp builds compatible with FrankenPHP. This approach would also have the benefit of not increasing much the binary size.

shyim, RafaelKr, and chapterjason reacted with rocket emoji

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

Reviewers

1 more reviewer

@shyimshyimshyim left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@dunglas@Kocal@kevinpapst@stof@tucksaun@shyim

[8]ページ先頭

©2009-2025 Movatter.jp