There was a problem loading the comments.

How to install Composer via CLI

Support Portal  »  Knowledgebase  »  Viewing Article

How to install Composer via CLI

To install Composer, you'll need to access the terminal from the control panel (DirectAdmin or cPanel).

SSH is available, but is only available/enabled on request.

If you require SSH access, please reach out to our team via a support ticket with the request, and we can have the feature enabled. 
Please follow this guide on how to raise a support ticket within your account. Click here.

 

Open the terminal from your control panel.

DirectAdmin:

08abb5f95ed3cfcc2c485fb5691e2832bd5219bbe0f76ed95bacdae875c7cb30caf32d577cf56110?t=4c6e21b41c4da6c05b1a58a839a98033

cPanel:

4c8ef8a13e3a5672266da2e78fbf5cb85120ef5cd1ec688c9387a3f4ba68cd2f99a2613409360539?t=75fb4f442a7d9cc594e6d6ddb1b59e5d

 

In the terminal, run the following commands to install Composer:

This will download the file and install Composer:

curl -sS https://getcomposer.org/installer | php

This will install Composer:

php composer.phar install

You may get an error if you haven't created a composer.json file: To initialise a project, please create a composer.json file. See https://getcomposer.org/basic-usage

 

To create an alias for it, use the following commands:

echo 'alias composer="php ~/composer.phar"' >> ~/.bashrc

source ~/.bashrc

composer install

Did you find this article useful?