Need enable embed SAPI
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!
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).
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: https://github.com/docker-library/php/compare/master...fizzka:add-embed
Seems like a sane approach -- what's the image size impact (before & after)?
Btw, I just pushed up https://github.com/docker-library/php/commit/ed0b10ebd4d144402976d5a6cb492f61db6c9c2a so you can drop cli-Dockerfile-block-2 and inherit the default from the template itself. :+1: :heart:
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?
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?
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?
Disclaimer: me and @leleobhz both work for the same company :)
Most helpful comment
Disclaimer: me and @leleobhz both work for the same company :)