How to fix Composer should be invoked via the CLI version of PHP, not the cgi-fcgi SAPI error in SSH?
Put this in your bash profile and run source ~/.bashrc alias composer="/opt/cpanel/ea-php71/root/usr/bin/php /opt/cpanel/composer/bin/composer" As Composer is now available via WHM you can use this to find it: which composer This returned path “/opt/cpanel/composer/bin/composer” for me. If this returns nothing then disregard the rest of this answer, as Composer is not available to you at system level. You can now use php-cli to call this with Composer’s absolute path: php-cli /opt/cpanel/composer/bin/composer install php-cli /opt/cpanel/composer/bin/composer update php-cli /opt/cpanel/composer/bin/composer require whatever/example You may however need to alias php-cli if your system claims this isn’t found. It very much depends how PHP has been deployed on the WHM server. Learn how to fix PHP CLI error. You can do this by adding a user alias to the end of your “.bashrc” or “.bash_profile” file as follows: ...