-
Notifications
You must be signed in to change notification settings - Fork 51
Description
When trying to run PIE 1.3.5 on PHP 8.5 (or any other supported PHP version) for PHP 7.1 and earlier, PIE bails with the following error:
root@f8d9759a97c6:/# php8.5 -f /usr/local/bin/pie-latest -- --with-php-config="/usr/bin/php-config7.1" --with-phpize-path="/usr/bin/phpize7.1" install asgrim/example-pie-extension
🥧 PHP Installer for Extensions (PIE) 1.3.5, from The PHP Foundation
In Assert.php line 2338:
Could not determine operating system family
install [-j|--make-parallel-jobs MAKE-PARALLEL-JOBS] [--skip-enable-extension] [--force] [-d|--working-dir WORKING-DIR] [--with-php-config WITH-PHP-CONFIG] [--with-php-path WITH-PHP-PATH] [--with-phpize-path WITH-PHPIZE-PATH] [--no-cache] [--allow-non-interactive-project-install] [--] [<requested-package-and-version>]
Likely offending code:
pie/src/Platform/TargetPhp/PhpBinaryPath.php
Lines 255 to 267 in 0fd52a2
| public function operatingSystemFamily(): OperatingSystemFamily | |
| { | |
| $osFamily = OperatingSystemFamily::tryFrom(strtolower(trim( | |
| self::cleanWarningAndDeprecationsFromOutput(Process::run([ | |
| $this->phpBinaryPath, | |
| '-r', | |
| 'echo PHP_OS_FAMILY;', | |
| ])), | |
| ))); | |
| Assert::notNull($osFamily, 'Could not determine operating system family'); | |
| return $osFamily; | |
| } |
The PHP_OS_FAMILY constant was added with PHP 7.2.
Currently there are no minimum PHP version requirements documented for PIE (or I didn't find them), so I'd expect it to be able to install extensions for basically any PHP version. I'm testing with oerdnj's deb packages from https://deb.sury.org/, the earliest PHP version available there is PHP 5.6. It would be great if PIE could install extensions even for such ancient versions, as long as PIE itself runs with a more recent PHP version of course (like PHP 8.5 in my case).