Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Composer PHP on Shared Space

I'm using Bluehost and do have access to SSH, thankfully. I've also set my PHP to 5.4 in the Control Panel settings. Now, here's the two big questions that I can't seem to grasp: how do I install Composer and furthermore, after installing Composer, how do I get the dependencies included?

In this case, I am attempting to use the official Tumblr PHP Library, which has dependencies -- all of which can be found on Packagist.

I've referred to this question in which the OP is using HostGator. I have attempted to install Composer in a similar fashion and have done so with seemingly successful results. The issue, however, is that I don't know where to install it on Bluehost so I now have Composer installed in several random places on the server simply because I don't know how to navigate to find where to put it in this shared space.

I know this is the issue (i.e. it's installed in the wrong place) because when I use the composer phar files and syntax to install the packages, I get errors saying the commands don't exist.

I really hate asking for hand-holding assistance, but if someone could walk me through the proper installation of Composer on a shared space and the proper installation of a Composer package from Packagist on the same shared space, it would be much appreciated. I've dug through the Composer documentation and can't seem to find a proper guide -- if one can even exist -- for this case. At this point, I'm wondering if it's going to be different for every web host.

like image 505
Ally Avatar asked Dec 07 '13 19:12

Ally


People also ask

Can I use composer on shared hosting?

Composer is a tool for dependencies management. It enables the user to easily download all the required packages/libraries that their PHP project can use. The tool is dependent on the PHP service. You can run Composer on shared hosting—it is available on all FastComet Shared Hosting plans.

Can I use composer in cPanel?

Your cPanel account must possess SSH access in order to use Composer. We added Composer in cPanel & WHM version 58.


1 Answers

Once you install composer as mentioned by KLVTZ. In the bluehost environment, use the php-cli instead of php.

php-cli composer.phar install
like image 182
Shaksi Avatar answered Oct 22 '22 04:10

Shaksi