frankenphp icon indicating copy to clipboard operation
frankenphp copied to clipboard

add ./install_dependencies.sh script, update build commands

Open henderkes opened this issue 7 months ago • 2 comments

maybe instead of #1565?

henderkes avatar May 23 '25 02:05 henderkes

I would also like to add information that the recommended way to build FrankenPHP is with xcaddy, given that users will expect mercure, vulcain and brotli to work.

henderkes avatar May 23 '25 02:05 henderkes

I'm not sure that's a good idea to include this script. End users should use the packages provided by their distributions for these dependencies, when available.

I'm not sure if that's a good idea. Wtr-watcher doesn't exist as a package as far as I know and while brotli does exist, the brotli-devel static library is built without -fPIC, meaning it fails static linking and falls back to shared linking against libbrolienc, libbrotlidec and libbrolicommon.so. Users will end up with a frankenphp that links against shared libraries that they most likely won't have installed on their production system.

The worst part is that gcc falls back to linking against the shared libraries silently. A user will never know why it depends on libbrotli's shared libraries unless they use ldd and know about gcc's linking intricacies.

henderkes avatar Jun 02 '25 14:06 henderkes

This will no longer be needed with static-php-cli being able to compile with a shared linked libphp.so.

henderkes avatar Jul 16 '25 13:07 henderkes