Skip to content
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

Need enable embed SAPI #510

Closed
ghost opened this issue Oct 17, 2017 · 10 comments
Closed

Need enable embed SAPI #510

ghost opened this issue Oct 17, 2017 · 10 comments

Comments

@ghost
Copy link

ghost commented Oct 17, 2017

Need enable embed SAPI

@tianon
Copy link
Member

tianon commented Dec 23, 2017

Going to need a lot more context, especially since Google isn't being terribly helpful in telling me what "embed SAPI" is, and I'm not familiar with it.

Is this something that would need to be enabled in the images by default? What's the primary use case? How does one use it? Is it an extension that could be compiled against an already-compiled PHP installation?

There's simply not enough information here for us to help, sorry!

@tianon tianon closed this as completed Dec 23, 2017
@fizzka
Copy link

fizzka commented Jan 19, 2018

#565

@tianon
Copy link
Member

tianon commented Jan 19, 2018

From what I can find, https://packages.debian.org/stretch/libphp7.0-embed is how Debian provides this functionality, which is a package to link your application against libphp.so for embedding PHP in other applications. This is totally unlike any of our existing variants, and IMO doesn't really make a lot of sense for us to provide (since you wouldn't use this image to run PHP, but rather simply to link against PHP, in which case it probably includes way more than you actually need by default).

@fizzka
Copy link

fizzka commented Jan 19, 2018

you are right about linking against libphp.so. example - https://unit.nginx.org/installation/ wants this binding.
as proposal: maybe add flag --enable-embed in cli variant?

my working scenario here: master...fizzka:add-embed

@tianon
Copy link
Member

tianon commented Jan 19, 2018

Seems like a sane approach -- what's the image size impact (before & after)?

Btw, I just pushed up ed0b10e so you can drop cli-Dockerfile-block-2 and inherit the default from the template itself. 👍 ❤️

@lubo
Copy link

lubo commented Dec 1, 2019

This is a deal breaker when trying to use PHP with NGINX Unit or uWSGI, so I'd really like to see this happen.

@fizzka Any chance you're still interested in working on this? If so, could you answer @tianon's question, please?
@tianon Is there something I can do to make this happen?

@leleobhz
Copy link

Hello!

Embed SAFI is needed for anything that links with the running PHP library. As said before, NGINX and uWSGI applications need this but any other application that needs libphp also needs this enabled. The "cost" is an additional .so inside the image.

In a multi-stage build, libphp allows ABI compatibility when the user needs to use a custom binary in conjunction with PHP application.

That said, may @tianon reopen this issue and consider add the --enable-embed flag?

@tianon
Copy link
Member

tianon commented Jun 25, 2021

See #1104 😉

@leleobhz
Copy link

Hello @tianon

I saw the PR #1104 but it only applies for CLI images. PHP ZTS is required to use pthreads with PHP so not only CLI image may require the additional libphp, but also ZTS as long it's more likely an application that uses pthreads needs dynamic linking into PHP..

Can you please accept the PR #1175 as @ygormutti asked for merge and keep ZTS and CLI with --enable-embed flag?

@ygormutti
Copy link

Disclaimer: me and @leleobhz both work for the same company :)

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

No branches or pull requests

5 participants