Bookmark: Set PHP for CLI on a WHM server


Bookmark: Set PHP for CLI on a WHM server

Update / proper solution: 

https://www.prodjex.com/2017/07/composer-issue-on-linux-with...


Trial and error below:

Go into the home directory of the user
Edit .bashrc and add the php version you want to use (php-cli version in this case) as an alias for php

For example in my case, php-cli for php v7 was located at /opt/cpanel/ea-php70/root/usr/bin/php

And to my bashrc file I added
alias php=/opt/cpanel/ea-php70/root/usr/bin/php

And that finally got the composer and other php cli commands working.

Featured photo by RealToughCandy