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