`frankenphp` extension has version `dev`, not 1.9.1
What happened?
Output of phpinfo shows version dev.
Build Type
This is what happens when you build with xcaddy using --with github.com/dunglas/frankenphp (which will automatically select the latest go package version, but not set -DFRANKENPHP_VERSION
Operating System
Unix
I assume this happens when building the static binary?
The version falls back to dev if the FRANKENPHP_VERSION Cgo flag is not set
https://github.com/php/frankenphp/blob/264f92835d4a60384207da8aa6d8df6abfa3202e/frankenphp.h#L9-L11
This is what happens when you build with xcaddy using --with github.com/dunglas/frankenphp (without having it set in CFLAGS, as it's not typically set there).
I'm fixing something in spc first and will get to this before shutting down for the night.
https://github.com/crazywhalecc/static-php-cli/commit/ed4978bb893bfc67109157f1b7c89a072d750a2c
This is what happens when you build with xcaddy using
--with github.com/dunglas/frankenphp(without having it set in CFLAGS, as it's not typically set there).
I'm not sure how to fix it for that.
Can you share the exact command you're running, might be some opportunity to inject the version at some point.
Other than that all I can think of is hard-coding the fallback to v1.91-dev, which isn't ideal.
https://frankenphp.dev/docs/compile/#using-xcaddy
You can run this command without ever cloning frankenphp, but the resulting compilation won't have FRANKENPHP_VERSION set. This no longer concerns static-php-cli's --build-frankenphp method since we already query for the version beforehand.
I'm also seeing this when rebuilding (from source) via brew -
go build -tags=nobadger nomysql nopgx -ldflags=-s -w -X "github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP 1.9.1 (Homebrew) PHP 8.4.14 Caddy" main.go
Could it be that we're not adding or passing the flag
-X 'github.com/dunglas/frankenphp.Version=1.9.1'" \
We can fix it for homebrew, but I feel like it might be more elegant to have the correct version available in code without passing -DFRANKENPHP_VERSION.
We can fix it for homebrew, but I feel like it might be more elegant to have the correct version available in code without passing
-DFRANKENPHP_VERSION.
Totally agree.
https://github.com/dunglas/homebrew-frankenphp/pull/21