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

php-config --version returns an empty string #563

Closed
dunglas opened this issue Nov 25, 2024 · 4 comments · Fixed by #569
Closed

php-config --version returns an empty string #563

dunglas opened this issue Nov 25, 2024 · 4 comments · Fixed by #569
Assignees
Labels
bug Something isn't working kind/php-and-sapi Issues related to php source and SAPI

Comments

@dunglas
Copy link
Contributor

dunglas commented Nov 25, 2024

Since recently, the php-config --version utility returns an empty string. It used to return the "human readable" PHP version.
The php-config --vernum flag works properly.

This affects PHP 8.3 as well as PHP 8.4. This doesn't look like an upstream bug because php-config --version works as expected in the official Docker image.

See also dunglas/frankenphp#1199

@dunglas
Copy link
Contributor Author

dunglas commented Nov 27, 2024

I investigated a bit:

Version is set to an empty string in buildroot/bin/php-config:

version=""

This is the root of the problem.

The generated version in configure and in php_version.h are good:

ac_IFS=$IFS; IFS="."
set $(echo 8.4.1 | "${SED}" 's/\([0-9\.]*\)\(.*\)/\1\.\2/')
IFS=$ac_IFS
PHP_MAJOR_VERSION=$1
PHP_MINOR_VERSION=$2
PHP_RELEASE_VERSION=$3
if ${PHP_EXTRA_VERSION:+false} :
then :
  PHP_EXTRA_VERSION=$4
fi
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=$(expr $PHP_MAJOR_VERSION \* 10000 + $PHP_MINOR_VERSION \* 100 + $PHP_RELEASE_VERSION)
#define PHP_VERSION "8.4.1"
#define PHP_VERSION_ID 80401

php-config seems to be generated from scripts/php-config.in, which contains:

version="@PHP_VERSION@"

It's this replacement that seems to be faulty, but I didn't have the time to track down why.

@dunglas
Copy link
Contributor Author

dunglas commented Nov 27, 2024

Ok, this comes from the config.status file, which contains an empty PHP_VERSION variable with SPC (but not for other builds):

S["PHP_VERSION"]=""

@crazywhalecc
Copy link
Owner

Seems some extension makes php version disappear. I tried to compile only several extensions and it's good.

For fastest tests, we may need to make an matrix, or only run configure and stop compiling for debugging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working kind/php-and-sapi Issues related to php source and SAPI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants