frankenphp icon indicating copy to clipboard operation
frankenphp copied to clipboard

`frankenphp` extension has version `dev`, not 1.9.1

Open henderkes opened this issue 2 months ago • 11 comments

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

henderkes avatar Nov 03 '25 14:11 henderkes

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

AlliBalliBaba avatar Nov 03 '25 18:11 AlliBalliBaba

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).

henderkes avatar Nov 03 '25 19:11 henderkes

I'm fixing something in spc first and will get to this before shutting down for the night.

henderkes avatar Nov 03 '25 19:11 henderkes

https://github.com/crazywhalecc/static-php-cli/commit/ed4978bb893bfc67109157f1b7c89a072d750a2c

henderkes avatar Nov 03 '25 19:11 henderkes

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.

henderkes avatar Nov 03 '25 19:11 henderkes

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.

AlliBalliBaba avatar Nov 04 '25 14:11 AlliBalliBaba

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.

henderkes avatar Nov 04 '25 17:11 henderkes

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'" \

cyformatician avatar Nov 07 '25 06:11 cyformatician

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.

henderkes avatar Nov 07 '25 13:11 henderkes

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.

cyformatician avatar Nov 07 '25 14:11 cyformatician

https://github.com/dunglas/homebrew-frankenphp/pull/21

henderkes avatar Nov 07 '25 14:11 henderkes