I am trying to create my own Laravel project, I need to use composer to update my vendor. I tried to use composer install at my repo using ssh, however, the ssh does not recognize composer command. I found this post. It says that by default, Bluehost comes with PHP 5.2 command line while Composer needs PHP 5.3 to run. Fortunately, Bluehost gives access to PHP 5.4 command line. It is as /ramdisk/php/54/php54-cli.
First, install Composer using the PHP 5.4.
- Make a directory called common at your root.
- cd into the directory.
- Install composer using php 5.4
curl -sS https://getcomposer.org/installer | /ramdisk/php/54/bin/php54-cli
Second, setup an alias for Composer.
- Set alias
echo “alias composer=’/ramdisk/php/54/bin/php54-cli ~/www/common/composer.phar’” >> ~/.bashrc
- Make alias into effect.
Done, now you can go into any directory and run Composer.
For my case, I can go into my Laravel repo and do Composer install or Composer update.