You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PHPC-2275: Always consult php-config for PHP version check in config.m4 (#1477)
Typically, PHP_VERSION and PHP_VERSION_ID are only defined when building the extension statically with PHP, since those variables are defined in php-src's own configure.ac. The variables are not defined when using phpize for a shared build.
The PHP Docker images for Alpine happen to define PHP_VERSION in their shell, but not PHP_VERSION_ID, which resulted in an "sh: out of range" error attempting to check the version. The shell-defined PHP_VERSION is also not necessarily the value we'd get from php-config (edge case where someone installs a different PHP version on top of an existing image).
This changes the logic to always rely on php-config to derive these values, as is done in various other extensions (e.g. xdebug, parallel). The awk one-liner that calculates PHP_VERSION_ID is also replaced with a direct call to `php-config --vernum`, which has been available since PHP 5.4 (php/php-src@f0fe4e0).
0 commit comments