we have a mix of different PHP versions running on your servers (max 5.3.5) and development machines (max 5.5.9).
Now we ran into the problem that we did a "composer update" to get the latest Version of some external Bundles. Since your composer.json looks like
"require": { "php": ">=5.3.3", ..... },
we get some Bundles that required PHP 5.5. No problem on our dev machines, but on the server :(
Is there any possibility to tell composer to require a PHP version between 5.3.3 and 5.3.5? Or a max available Version?
I tried
"require": { "php": ">=5.3.3, <=5.3.5", ..... },
and
"require": { "php": "<=5.3.5", ..... },
but both didn't work out. I get a "The requested package php could not be found in any version, there may be a typo in the package name." Error.
Any Ideas? Thanks in advance
To change to version one run the self-update command and pass in the --1 flag. This will change composer to version one and now you can install your dependencies. Once you have installed your dependencies, now you can run the same command and pass in --2 as the flag and this will switch back to composer version 2.
First, grab this URL: https://composer.github.io/pubkeys.html . From there, the terminal will prompt you for which key you need to enter. Once done, you should be able to complete the downgrade process.
An alternative is to set your minimum-stability to dev, but tell composer you want to use stable whenever possible: "minimum-stability": "dev", "prefer-stable" : true. This basically means it will always use stable UNLESS there is no way to install a stable dependency, and therefore use dev.
Since the config parameter in composer.json is available. You could something like this:
{ "name": ".../...", "config": { "platform": { "php": "5.3.5" } }, "require": { ... } }
https://getcomposer.org/doc/06-config.md#platform
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