I
I
Ivan2020-08-15 12:27:36
linux
Ivan, 2020-08-15 12:27:36

How to install Composer and on which OS?

I've been fiddling with CentOS 6.9 x32 and 7.6 x64 for two days, trying to install Composer correctly.
It didn’t work on vps from ihc, I created droplets on digitalocean twice on different versions of CentOS, I seem to have figured everything out, later I even deployed ISP, but Composer still doesn’t want to work correctly.
When I try to deploy something from github using ssh commands, for example,
composer require sociallydev/spaces-api:dev-masterI get constant errors.

I tried to deploy different repositories and there are always errors, sometimes the installation seems to have gone, but at the end an error message and deletion of the composer.json file

Often I get an error message about the php version, you have 5.3. that I have 7.1.3 version.

I don't understand anything.

What could be causing such problems?
Does it make sense to switch to ubuntu?

Haven't worked with Composer before.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sanes, 2020-08-15
@9StarRu

Find where the binary of the required version is located and run through it.
Something like this:
/opt/php/7.2/cli/bin/php composer.phar
You can register an alias for php or change the default version of php-cli on the server through alternatives.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question