Skip to content

Instantly share code, notes, and snippets.

@anavdesign
Created January 19, 2019 20:07
Show Gist options
  • Save anavdesign/bc15b02f2e139d957041b4662c81acc1 to your computer and use it in GitHub Desktop.
Save anavdesign/bc15b02f2e139d957041b4662c81acc1 to your computer and use it in GitHub Desktop.
Remote: Composer Install

Composer Installation

Connect to Remote Server

$ ssh ALIAS

Shared Hosting

  1. Download Composer

    $ curl -sS https://getcomposer.org/installer | php
    
  2. Make Common Directory

    $ mkdir common
    
  3. Move Composer to Common Directory

    $ mv composer.phar common
    
  4. Add Composer .bash_profile

    alias composer="/opt/php70/bin/php ~/common/composer.phar"
    
  5. Confirm Composer Install

    $ composer
    

AWS Linux

  1. Install composer on AWS Linux

    https://pinecode.io/article/install-composer-on-aws-linux

    Install composer using the supplied installer.

    $ sudo curl -sS https://getcomposer.org/installer | sudo php
    
  2. Move composer.phar

    You'll notice that you now have a PHAR file in your working directory. We need to move this file to our global path

    $ sudo mv composer.phar /usr/local/bin/composer
    
  3. Create Phar Symbolic Link

    $ sudo ln -s /usr/local/bin/composer /usr/bin/composer
    

Remove Composer

https://stackoverflow.com/questions/30396451/remove-composer

  1. Uninstall composer

    To remove just composer package itself from Ubuntu 16.04 (Xenial Xerus) execute on terminal:

    $ sudo apt-get remove composer
    
  2. Uninstall composer and it's dependent packages

    To remove the composer package and any other dependant package which are no longer needed from Ubuntu Xenial.

    $ sudo apt-get remove --auto-remove composer
    
  3. Purging composer

    If you also want to delete configuration and/or data files of composer from Ubuntu Xenial then this will work:

    $ sudo apt-get purge composer
    

    To delete configuration and/or data files of composer and it's dependencies from Ubuntu Xenial then execute:

    $ sudo apt-get purge --auto-remove composer
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment