Web Applications

How to Install Composer

In this article we describe how to install and configure PHP Composer, a Dependency Manager for PHP, on your Ecenica shared hosting account.

Steps to install Composer

  1. Log in to your account via SSH.
  2. Enter the following command, replacing USERNAME with your own cPanel account username.
    echo 'alias composer="php -d allow_url_fopen=On /home/USERNAME/composer.phar"' >> ~/.bashrc
    
  3. Enter the following command to load the new bash enviroment variables.
    source ~/.bashrc
    
  4. Download the Composer installer.
    cd ~ ; curl -k -O https://getcomposer.org/installer
    
  5. Install Composer.
    php -d allow_url_fopen=On installer
    
  6. Confirm Composer is installed.
    composer -V
    

    If successfully installed, Composer will return the version number. For example:

    Composer version 1.9.0 2019-08-02 20:55:32
    
  7. To update Composer to the latest version run the following command:
    composer self-update
    

Was this guide helpful?

Need help with this?

Open a ticket and link to this guide so our team can see what you have tried.

View support tickets

Power your business with Ecenica Hosting

Built for WordPress and serious websites. Fast, secure and supported by real people in the UK.

Ecenica hosting services represented by a connected red route across London