Install Composer on Bluehost for SilverStripe

logo composer transparent4

If you need to use composer, which you should do if you are using SilverStripe, to maintain and update your site from your localhost via git then here are some simple instructions to setup composer on your shared hosting.

The problem is that you will be running your site on one version of php and the command line on a different version. At the time of writing this post my site is running PHP5.4 and the command line is PHP5.2 so we need to make sure that both the site and cli are on PHP5.4

In your .htaccess file you will need to add this to the top

# Use PHP5.4 Single php.ini as default
AddHandler application/x-httpd-php54s .php

First of all you will need to get ssh access from hosting company.

Install composer the normal way

cd ~
curl -sS | php

Then move the the composer.phar file into your bin directory

mv composer.phar ~/bin/composer.phar

 Add the path of the php version you want and the composer.phar to the bottom of your bashrc file

You might need to dig around to find the correct path to the php version you want.

cd ~
vim .bashrc
alias composer="/usr/php/54/bin/php54-cli ~/bin/composer.phar"

Then reload your bashrc file

source .bashrc

then type composer and your should see your composer options you should then be set to use composer to install SilverStripe and any modules that you need rather than uploading them.

Post your comment


No one has commented on this page yet.

RSS feed for comments on this page | RSS feed for all comments

Copywrite © 2018 Kevin Phillips All rights are reserved.

Proudly supporting opensource software