On CentOS 7, I installed PHP 7.1.
Then I installed composer with:
cd /tmp curl -sS https://getcomposer.org/installer | php71 --> used php71 inste
As @alexhowansky suggested, I ran the following command:
sudo ln -s /usr/bin/php71 /usr/bin/php
Now the composer command works. Thanks