What I suggest you to do is to call php and composer where they are installed on your server and execute only one istance.
I have many versions of php, composer and so on, so to be sure everything is gioing fine I just install composer in the domain directory and execute the php version I desire.
EXAMPLE:
CALLING PHP:
/opt/plesk/php/5.6/bin/php
CALLING COMPOSER (installed in domain)
/opt/plesk/php/5.6/bin/php /var/www/vhosts/communiti.ch/composer.phar
SO FULL COMMAND TO EXECUTE installation
to execute while in correct directory (in my example i was in /var/www/vhosts/communiti.ch/beta.communiti.ch/)
/opt/plesk/php/5.6/bin/php /var/www/vhosts/communiti.ch/composer.phar create-project flarum/flarum --stability=beta