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
👋 We have an issue when trying to run composer install on a different PHP version than the target system (local environment uses PHP 8 but prod uses PHP 5.6)
The issue is that autoload_real.php generates this line:
Parse error: syntax error, unexpected '(' in /var/www/vendor/composer/autoload_real.php on line 32
What we have done is to configure platform in composer.json:
"platform": {
"php": "5.6"
}
I would then anticipate that a PHP 5.6-compatible autoloader would be generated. At the very least the autoloader code should not depend on the PHP version of the environment that triggers composer install.
This approach used to work up until some time ago, although I don't know at exactly which version it broke.
PS. I understand this is a niche problem, we are using a legacy environment and it's quite hard for us to run Composer in PHP 5.6, hence I'm creating this issue.
The text was updated successfully, but these errors were encountered:
@stof Thanks so much for quickly pointing me to the right place, following the install guide and picking the 2.2 LTS at the end worked perfectly and generated a valid autoloader for PHP 5.6.
I took a look and it seems we really can easily support 5.6 still for autoloading purposes, so I fixed that in e0cce2b which will be available in 2.3.4 - hopefully you can then go back to using the latest Composer version :)
👋 We have an issue when trying to run
composer install
on a different PHP version than the target system (local environment uses PHP 8 but prod uses PHP 5.6)The issue is that
autoload_real.php
generates this line:This causes a PHP error:
What we have done is to configure
platform
incomposer.json
:I would then anticipate that a PHP 5.6-compatible autoloader would be generated. At the very least the autoloader code should not depend on the PHP version of the environment that triggers
composer install
.This approach used to work up until some time ago, although I don't know at exactly which version it broke.
Output of
composer diagnose
:PS. I understand this is a niche problem, we are using a legacy environment and it's quite hard for us to run Composer in PHP 5.6, hence I'm creating this issue.
The text was updated successfully, but these errors were encountered: