Cara Install Composer di Ubuntu

Composer merupakan perangkat dependency manager untuk PHP. Seorang developer dapat mendeklarasikan library yang dibutuhkan dalam proyek aplikasi PHP yang kemudian akan diinstalasi dan diperbarui oleh Composer tanpa harus diunduh satu per satu.

Install Composer

[INPUT]

1 2 3 sudo apt-get install curl php-cli php-mbstring git unzip curl “€“sS https://getcomposer.org/installer | php sudo mv composer.phar /usr/local/bin/composer

Pengujian

Menjalankan composer

[INPUT]

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 composer     / ____/___  ____ ___  ____  ____  ________  _____ / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/ / /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ / \____/\____/_/ /_/ /_/ .___/\____/____/\___/_/                     /_/ Composer version 1.4.2 2017-05-17 08:17:52   Usage:   command [options] [arguments]   Options:   -h, –help                     Display this help message   -q, –quiet                    Do not output any message   -V, –version                  Display this application version       –ansi                     Force ANSI output       –no-ansi                  Disable ANSI output   -n, –no-interaction           Do not ask any interactive question       –profile                  Display timing and memory usage information       –no-plugins               Whether to disable plugins.   -d, –working-dir=WORKING-DIR  If specified, use the given directory as working directory.   -v|vv|vvv, –verbose           Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug   Available commands:   about           Short information about Composer.   archive         Create an archive of this composer package.   browse          Opens the package’s repository URL or homepage in your browser.   clear-cache     Clears composer’s internal package cache.   clearcache      Clears composer’s internal package cache.   config          Set config options.   create-project  Create new project from a package into given directory.   depends         Shows which packages cause the given package to be installed.   diagnose        Diagnoses the system to identify common errors. …

Menampilkan versi composer

[INPUT]

1 2 composer -V   Composer version 1.4.2 2017-05-17 08:17:52

Menampilkan help

[INPUT]

1 composer help

Update composer

[INPUT]

1 2 3 4 composer self-update Updating to version 1.6.2 (stable channel).    Downloading (100%)         Use composer self-update –rollback to return to version 1.4.2

Ketika menjalankan perintah composer misalnya instalasi paket, pastikan jaringan internet yang digunakan stabil.

selamat mencoba 🙂

Leave a Reply

Your email address will not be published.