And there really is no way to make Composer deal with this situation. The PHP version that is used when running composer update determines the resolution of dependencies, being influenced by PHP version and installed PHP extensions. You cannot define that a package should only be used for PHP versions between 5.3.
So, while the 7.2 version is used to run Composer, the scripts called by Composer use the default command.
All packages using composer are still mere directories full of PHP files. You can install them exactly the same way you did before composer existed: copy them somewhere and include the files. Composer-based installation implies running a single command, which is almost always shown in the package home page.
I've found the option:
composer install --ignore-platform-reqs
Ignore platform requirements (php & ext- packages).
Edit: You can skip the platform checks with this, but Composer will fetch packages based on given PHP version then. So when you need composer to also emulate a PHP version during depedency resolving, you can (and should!) use this in your composer.json:
{
"config": {
"platform": {
"php": "5.6.6"
}
}
}
https://getcomposer.org/doc/06-config.md#platform
For many commands, you can tell composer to bypass php version check, with parameter "--ignore-platform-reqs
":
composer COMMAND --ignore-platform-reqs
this will bypass php version specification.
Be aware that the software may work or not: php version specification is there because somewhere in the code is needed at least the specified php version, so if you use that code the software will break.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With