I've been stuck at this for a few days. I'm using 1and1 hosting, and they have their PHP set up a bit weird.
If I use just php composer.phar install
, then I'm using PHP 4.4.6, which is horribly insufficient. However, I can run php5.5 composer.phar install
, get a little bit further, but it still fails because somewhere along the line, PHP is called again, but it fails, as it's using 4.4.6.
Is there any way to tell Composer to use the php5.5
command? Has anyone successfully gotten Composer configured on 1and1 hosting?
I'm trying to get Laravel up and running (which uses Composer). I've been able to do it on my GoDaddy domain, but not 1and1.
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.
It also makes maintaining the latest versions of all required libraries easier because you can simply run composer update to get the latest compatible packages.
Ubuntu 18.04 case ... this run for me.
/usr/bin/php7.1 /usr/local/bin/composer update
Maybe this can't solve exactly your issue but probably it will help others who comes here from web search.
Just add below code to your composer.json file to set different php version:
"config": { "platform": { "php": "7.1.3" } }
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